liondgr8
2012-May-29 13:47 UTC
[Puppet Users] how to reassign variable extlookup in manifest files
Hi puppet users, I would like to know how to reassign the global variables specifically extlookup_datadir, extlookup_precedence. 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. Kindly suggest, as I am stuck over it.. Regards, Pranay -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2012-May-30 13:05 UTC
[Puppet Users] Re: how to reassign variable extlookup in manifest files
On May 29, 8:47 am, liondgr8 <coolbuddy...@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@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.