Skip to content

Commit

Permalink
Made compatible with MS Windows 2003 R2.
Browse files Browse the repository at this point in the history
  • Loading branch information
new23d committed May 12, 2014
1 parent 16f6874 commit 8164c4d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 71 deletions.
57 changes: 0 additions & 57 deletions opt/Facter_CEF.xml

This file was deleted.

8 changes: 7 additions & 1 deletion opt/facter_cef.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
## basic config start

var_cached_facts_file = ENV['ProgramData'] + '/PuppetLabs/facter/facts.d/facter_cef.yaml'
if ENV.key('ProgramData')
var_platform_program_data = ENV['ProgramData']
else
var_platform_program_data = ENV['ALLUSERSPROFILE'] + '\Application Data'
end

var_cached_facts_file = var_platform_program_data + '/PuppetLabs/facter/facts.d/facter_cef.yaml'

var_expensive_facts_regex = [
'network_.*',
Expand Down
16 changes: 9 additions & 7 deletions opt/service.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,22 @@ set var_puppet_value_name="RememberedInstallDir"

for /f "usebackq skip=1 tokens=1,2*" %%a in (`reg query %var_puppet_key_name% /v %var_puppet_value_name%`) do (set var_puppet_base_dir=%%c)

if defined ProgramData (set var_platform_program_data=%ProgramData%) else (set var_platform_program_data=%ALLUSERSPROFILE%\Application Data)

set var_mcollective_base_dir=%ProgramFiles(x86)%\MCollective\
set var_mcollective_etc_dir=%ProgramData%\MCollective\etc\
set var_mcollective_etc_dir=%var_platform_program_data%\MCollective\etc\

set var_programfilesx86_dir=%ProgramFiles(x86)%

if not exist %ProgramData%\MCollective\etc\server.cfg (
if not exist "%var_mcollective_etc_dir%server.cfg" (
echo ^
main_collective = mcollective^

#collectives = mcollective,gotham_collective^

libdir = !var_programfilesx86_dir!\MCollective\plugins^

logfile = %ProgramData%\MCollective\var\log\server.log^
logfile = %var_platform_program_data%\MCollective\var\log\server.log^

loglevel = debug^

Expand Down Expand Up @@ -57,7 +59,7 @@ plugin.rabbitmq.pool.size = 1^

factsource = facter^

plugin.facter.facterlib = %ProgramData%\PuppetLabs\puppet\var\lib\facter^
plugin.facter.facterlib = %var_platform_program_data%\PuppetLabs\puppet\var\lib\facter^

^

Expand All @@ -77,13 +79,13 @@ rpcaudit = 1^

rpcauditprovider = logfile^

plugin.rpcaudit.logfile = %ProgramData%\MCollective\var\log\audit.log^
plugin.rpcaudit.logfile = %var_platform_program_data%\MCollective\var\log\audit.log^

^

classesfile = %ProgramData%\PuppetLabs\puppet\var\state\classes.txt^
classesfile = %var_platform_program_data%\PuppetLabs\puppet\var\state\classes.txt^

> %ProgramData%\MCollective\etc\server.cfg
> "%var_mcollective_etc_dir%server.cfg"
)

call "%var_puppet_base_dir%bin\environment.bat"
Expand Down
11 changes: 5 additions & 6 deletions wxs/mcollective.wxs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version='1.0' encoding='utf-8'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='MCollective' Version='2.5.0002' Id='*' UpgradeCode='D1B7E318-BED6-430C-9194-9427BEA29797' Language='1033' Codepage='1252' Manufacturer='new23d'>
<Package Id='*' Compressed='yes' InstallerVersion='400' />
<Product Name='MCollective' Version='2.5.0003' Id='*' UpgradeCode='D1B7E318-BED6-430C-9194-9427BEA29797' Language='1033' Codepage='1252' Manufacturer='new23d'>
<Package Id='*' Compressed='yes' InstallerVersion='300' />
<Media Id='1' Cabinet='mcollective' EmbedCab='yes' />

<MajorUpgrade DowngradeErrorMessage='A later version of MCollective is already installed. Setup will now exit.' />

<Property Id='PUPPETLABSINSTALLED'>
<RegistrySearch Id='PuppetLabsRememberedInstallDir' Type='raw' Root='HKLM' Key='SOFTWARE\Wow6432Node\Puppet Labs\Puppet' Name='RememberedInstallDir' />
<RegistrySearch Id='PuppetLabsRememberedInstallDir' Type='raw' Root='HKLM' Key='SOFTWARE\Puppet Labs\Puppet' Name='RememberedInstallDir' Win64='no' />
</Property>

<Condition Message='Puppet from Puppet Labs is a requirement.'>
Expand All @@ -25,7 +25,6 @@
</Component>
<Component Id='FacterCEF' Guid='816A2919-0BFD-41C1-A231-89D53690981C'>
<File Source='..\opt\facter_cef.rb' />
<File Source='..\opt\Facter_CEF.xml' />
<File Source='..\opt\facter_cef.bat' />
</Component>
</Directory>
Expand Down Expand Up @@ -59,7 +58,7 @@
</Directory>
</Directory>

<CustomAction Id='FacterCEFScheduledTaskCreate' Directory='Opt' ExeCommand='schtasks /create /f /xml ..\opt\Facter_CEF.xml /tn Facter_CEF' Execute='deferred' Impersonate='no' />
<CustomAction Id='FacterCEFScheduledTaskCreate' Directory='Opt' ExeCommand='schtasks /create /ru system /sc daily /tn Facter_CEF /tr "%ProgramFiles(x86)%\MCollective\opt\facter_cef.bat" /ri 10 /f' Execute='deferred' Impersonate='no' />
<CustomAction Id='FacterCEFScheduledTaskDelete' Directory='Log' ExeCommand='schtasks /delete /f /tn Facter_CEF' Execute='commit' Impersonate='no' />

<InstallExecuteSequence>
Expand All @@ -77,4 +76,4 @@
<ComponentRef Id='FacterCEFYamlFile' />
</Feature>
</Product>
</Wix>
</Wix>

0 comments on commit 8164c4d

Please sign in to comment.