Hi there,
I like to have my environments organized into multiple subdirectories. Puppet configuration supports that by defining multiple paths for environmentpath setting, separated by ':'.
However, I find it very convenient to use this simple configuration line:
environmentpath = /etc/puppet/env/*
instead of this one:
environmentpath = /etc/puppet/env/SUB1:/etc/puppet/env/SUB2:/etc/puppet/env/SUB3:/etc/puppet/env/SUBx
The patch for this convenience is a simple one-line change:
---------------------------------------------------------------------------
--- puppet/settings/path_setting.rb.ORIG 2015-03-08 19:05:33.758705374 +0000
+++ puppet/settings/path_setting.rb 2015-03-07 01:59:31.127330981 +0000
@@ -1,7 +1,7 @@
class Puppet::Settings::PathSetting < Puppet::Settings::StringSetting
def munge(value)
if value.is_a?(String)
- value = value.split(File::PATH_SEPARATOR).map { |d| File.expand_path(d) }.join(File::PATH_SEPARATOR)
+ value = value.split(File::PATH_SEPARATOR).map { |d| File.expand_path(d) }.map { |d| Dir.glob(d) }.join(File::PATH_SEPARATOR)
end
value
end
---------------------------------------------------------------------------
I haven't tested this with adding subdirs AFTER master is already started, thought, but a simple 'touch puppetmaster.conf' should do the trick if new directories are not picked up by default.
Would there be any interest for merging mentioned change upstream?
b.