Is it possible to access Puppet master configuration variables (like confdir, masterport, etc) from within a Puppet manifest?
Is it possible to access Puppet master configuration variables (like confdir, masterport, etc) from within a Puppet manifest?
There are three ways.
Put this in a file called 'getconf.rb' in your puppet server's libdir (
/var/puppet/lib/puppet/parser/functions/getconf.rb
) and access it from a manifest like2. In Puppet 2.6 it's even easier as the whole settings setup is accessible as
${settings::somevar}
, so the manifest is simply:3. In puppet 0.25 you can use an inline template:
Methods 2 and 3 thanks to this thread on puppet-users