From 8164c4dd61b349a11a7b3d74c119ccb7dad198bc Mon Sep 17 00:00:00 2001 From: new23d Date: Mon, 12 May 2014 15:02:06 +0100 Subject: [PATCH] Made compatible with MS Windows 2003 R2. --- opt/Facter_CEF.xml | 57 --------------------------------------------- opt/facter_cef.rb | 8 ++++++- opt/service.bat | 16 +++++++------ wxs/mcollective.wxs | 11 ++++----- 4 files changed, 21 insertions(+), 71 deletions(-) delete mode 100644 opt/Facter_CEF.xml diff --git a/opt/Facter_CEF.xml b/opt/Facter_CEF.xml deleted file mode 100644 index 033af64..0000000 --- a/opt/Facter_CEF.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 2014-04-15T00:00:00 - new23d - Facter Caching of Expensive Facts - - - - - PT10M - false - - 2014-01-01T00:00:00 - PT9M - true - - - PT9M - true - - - PT9M - true - - - - - S-1-5-18 - HighestAvailable - - - - IgnoreNew - false - true - true - true - false - - true - false - - true - true - false - false - false - PT0S - 8 - - - - "%ProgramFiles(x86)%\MCollective\opt\facter_cef.bat" - - - \ No newline at end of file diff --git a/opt/facter_cef.rb b/opt/facter_cef.rb index 5232800..fb378cb 100644 --- a/opt/facter_cef.rb +++ b/opt/facter_cef.rb @@ -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_.*', diff --git a/opt/service.bat b/opt/service.bat index cc5005b..bb562cf 100644 --- a/opt/service.bat +++ b/opt/service.bat @@ -6,12 +6,14 @@ 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^ @@ -19,7 +21,7 @@ main_collective = mcollective^ 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^ @@ -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^ ^ @@ -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" diff --git a/wxs/mcollective.wxs b/wxs/mcollective.wxs index 72f1c8e..e328879 100644 --- a/wxs/mcollective.wxs +++ b/wxs/mcollective.wxs @@ -1,13 +1,13 @@ - - + + - + @@ -25,7 +25,6 @@ - @@ -59,7 +58,7 @@ - + @@ -77,4 +76,4 @@ - + \ No newline at end of file