On 11-01-31 01:09 PM, Nan Liu wrote: >> I've done a quick test to print (notify{}) the value of $vardir and it's >> > empty. Do you guys know of a way I could access this value within the >> > module's manifests? > Yeah, that would make manifests a lot more flexible. Here's a function > that should work for this purpose and potentially other puppet > configuration variables as well: > > # puppet_vardir.rb > module Puppet::Parser::Functions > newfunction(:puppet_vardir, :type => :rvalue) do > Puppet[:vardir] > end > end
hmm, that's interestingly very simple. I would personally use a fact instead of a function, but now that I know the ruby part to fetch the config value, writing a fact shouldn't be too difficult. thanks, -- Gabriel Filion -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.