Is it possible to access Puppet master configuration variables (like confdir, masterport, etc) from within a Puppet manifest?
|
feedback
|
|
There are three ways.
module Puppet::Parser::Functions
newfunction(:getconf, :type => :rvalue, :doc =>
2010-09-29
The getconf function takes a single argument, the name of a
configuration setting and returns the value of that setting.
It is similar to the --configprint command line argument to
return configuration settings except it exposes this information
to the language.
END_HEREDOC
do |args|
if args.length != 1 then
raise Puppet::ParseError, ("ERROR: getconf() takes only one argument")
end
Puppet[args[0]]
end # do |args|
end # module
# EOF
Put this in a file called 'getconf.rb' in your puppet server's libdir (
2. In Puppet 2.6 it's even easier as the whole settings setup is accessible as
3. In puppet 0.25 you can use an inline template:
Methods 2 and 3 thanks to this thread on puppet-users | ||||
|
feedback
|
|
not as far as i know. what are you trying to do? | |||||||||||
feedback
|