summaryrefslogtreecommitdiffstats
path: root/install.rb
diff options
context:
space:
mode:
authorJosh Cooper <josh@puppetlabs.com>2011-07-29 09:37:58 -0700
committerJosh Cooper <josh@puppetlabs.com>2011-07-29 10:45:38 -0700
commit95b21dfde7d77a61633555f20f2e3b9675d48415 (patch)
treed13b5a3c73fa9a6f3060c28da7111a347547e321 /install.rb
parentca3396e827d4abd0350440223d0925d685a3caa5 (diff)
downloadpuppet-95b21dfde7d77a61633555f20f2e3b9675d48415.tar.gz
puppet-95b21dfde7d77a61633555f20f2e3b9675d48415.tar.xz
puppet-95b21dfde7d77a61633555f20f2e3b9675d48415.zip
(#8660) Default config dir to %PROGRAMDATA% on Windows
The puppet install.rb script now defaults the config directory to %PROGRAMDATA%\PuppetLabs\puppet\etc on Windows. This is more inline with Windows best-practices, as this directory is used to store application data across all users. The PROGRAMDATA environment variable also takes into account alternate system drives, by using the SYSTEMDRIVE environment variable. Note that the Dir::COMMON_APPDATA constant is so named because it corresponds to the CSIDL_COMMON_APPDATA constant, which on 2000, XP, and 2003 is %ALLUSERSPROFILE%\Application Data, and on Vista, Win7 and 2008 is %SYSTEMDRIVE%\ProgramData. This commit also updates puppet's default run_mode var and conf directories when running as "root" to match the install script, and fixes the spec test, which was looking in the Dir::WINDOWS directory. Reviewed-by: Cameron Thomas <cameron@puppetlabs.com>
Diffstat (limited to 'install.rb')
-rwxr-xr-xinstall.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/install.rb b/install.rb
index 784ec8c9b..03bcfa06b 100755
--- a/install.rb
+++ b/install.rb
@@ -243,6 +243,9 @@ def prepare_installation
if not InstallOptions.configdir.nil?
configdir = InstallOptions.configdir
+ elsif $operatingsystem == "windows"
+ require 'win32/dir'
+ configdir = File.join(Dir::COMMON_APPDATA, "PuppetLabs", "puppet", "etc")
else
configdir = "/etc/puppet"
end