On 2015-08-03 20:10, Bostjan Skufca wrote:
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.ORIG2015-03-08 19:05:33.758705374 +0000
+++ puppet/settings/path_setting.rb2015-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?
This convenience looks like a useful addition. Please log a feature
request and submit a PR.
- henrik
--
Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/
--
You received this message because you are subscribed to the Google Groups "Puppet
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-dev/mdk63b%244dh%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.