30 May 2012 15:05
[Puppet Users] Re: how to reassign variable extlookup in manifest files
jcbollinger <John.Bollinger <at> stJude.org>
2012-05-30 13:05:03 GMT
2012-05-30 13:05:03 GMT
On May 29, 8:47 am, liondgr8 <coolbuddy... <at> gmail.com> wrote: > Hi puppet users, > > I would like to know how to reassign the global variables specifically > extlookup_datadir, extlookup_precedence. You cannot change the value of any variable once it's set. > My use case is in such a way that suppose I have 2 agents handled by > master. > Agent1 requires the custom parameters for the module installation. > These parameter files(*.csv) are independent of the different agents. > > What I did, I made different manifest files including there related > lookup datadir, and precedence order. But puppet cant reassign > extlookup as these are global variables. > > How can I pass different parameters from different parameter files on > various modules as each agent have different manifest files. I thought extlookup resolved its controlling variables from the current scope via Puppet's normal resolution mechanism. That would mean that if you set local variables $extlookup_datadir and $extlookup_precedence within the class calling extlookup(), then the function should use them (and if not, it should use the global variables). Alternatively, you could switch to hiera, the newer, more powerful younger brother of extlookup(). It has a more flexible mechanism for choosing among various possible values for a given key, among many other advantages. John -- -- 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 <at> googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe <at> googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
RSS Feed