Hello all, I have read through the sparse documentation on the Search (intentionally capitalized to differentiate from the verb) function as well as searched the group list (and mail archives) with little success to finding an answer. It is my understanding that I want to use the Search function to achieve my goal. I would like to know: a) is my understanding about the purpose of this function incorrect? b) the recommended way to accomplish making variables defined in classes available to other classes, dynamically (see below as an example). Using a contrived example, I have a series of classes with site-specific settings & variables: site::office site::datacenter etc. In each of these classes I have some site-specific variables defined that I want to be able to reference in other classes. manifests/site.pp: $site_name = "office" site/manifests/office.pp: class site::office inherits site::common { $dns1 = "1.2.3.4" $dns2 = "2.3.4.5" $search = "$site_name.local" } bind/manifests/dns.pp: class dns::client inherits dns::common { search "site::$site_name" file { "/etc/resolv.conf" : content => "search $search\n nameserver $dns1\nnameserver $dns2\n" } } I get error that the variables, $search, $dns1, et cetera are unknown. Thank you and regards, Robb --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mon, Feb 23, 2009 at 09:29:53AM -0800, Robb Wagoner wrote:> I would like to know: > a) is my understanding about the purpose of this function incorrect? > b) the recommended way to accomplish making variables defined in classes > available to other classes, dynamically (see below as an example).Your understanding is incorrect. I came up against this lack of documentation the other day so went looking to see what the code did; it turns out that it adds nested classes and defines from other classes into the local class but not variables. You''ll find the relevant code in parser.rb and scope.rb. -- Bruce Explota!: miles de lemmings no pueden estar equivocados. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi> On Mon, Feb 23, 2009 at 09:29:53AM -0800, Robb Wagoner wrote: >> I would like to know: >> a) is my understanding about the purpose of this function incorrect? >> b) the recommended way to accomplish making variables defined in classes >> available to other classes, dynamically (see below as an example). > > Your understanding is incorrect. I came up against this lack of > documentation the other day so went looking to see what the code did; it > turns out that it adds nested classes and defines from other classes > into the local class but not variables. You''ll find the relevant code > in parser.rb and scope.rb.would be nice if you could add this documentation to the wiki, because... eh it''s a wiki! thanks and cheers pete --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bruce, Thank you for the explanation. I will review the parser.rb and scope.rb to familiarize myself with the code. On Feb 23, 9:40 am, Bruce Richardson <itsbr...@workshy.org> wrote:> On Mon, Feb 23, 2009 at 09:29:53AM -0800, Robb Wagoner wrote: > > I would like to know: > > a) is my understanding about the purpose of this function incorrect? > > b) the recommended way to accomplish making variables defined in classes > > available to other classes, dynamically (see below as an example). > > Your understanding is incorrect. I came up against this lack of > documentation the other day so went looking to see what the code did; it > turns out that it adds nested classes and defines from other classes > into the local class but not variables. You''ll find the relevant code > in parser.rb and scope.rb. > > -- > Bruce > > Explota!: miles de lemmings no pueden estar equivocados.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Mon, Feb 23, 2009 at 06:56:05PM +0100, Peter Meier wrote:> > would be nice if you could add this documentation to the wiki, > because... eh it''s a wiki!The functions reference page is autogenerated. What is the source, if I am to update it? -- Bruce What would Edward Woodward do? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Bruce Richardson wrote:> On Mon, Feb 23, 2009 at 06:56:05PM +0100, Peter Meier wrote: >> would be nice if you could add this documentation to the wiki, >> because... eh it''s a wiki! > > The functions reference page is autogenerated. What is the source, if I > am to update it? >Log a ticket in Redmine with your updates. Thanks James Turnbull - -- Author of: * Pulling Strings with Puppet (http://www.amazon.com/gp/product/1590599780/) * Pro Nagios 2.0 (http://www.amazon.com/gp/product/1590596099/) * Hardening Linux (http://www.amazon.com/gp/product/1590594444/) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJo8h59hTGvAxC30ARAk59AKCl8vmZK6yzKw5XgrjBry/8g4MeNACfYTBm Y3YZIy30BmIv9XpydMgJPiE=M+vB -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi>> would be nice if you could add this documentation to the wiki, >> because... eh it''s a wiki! > > The functions reference page is autogenerated. What is the source, if I > am to update it?the code. However for more extended example it might be nice to create wiki page. But if it''s just a few lines, I think James is fine with code patches. cheers pete --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Tue, Feb 24, 2009 at 09:14:18PM +1100, James Turnbull wrote:> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Bruce Richardson wrote: > > On Mon, Feb 23, 2009 at 06:56:05PM +0100, Peter Meier wrote: > >> would be nice if you could add this documentation to the wiki, > >> because... eh it''s a wiki! > > > > The functions reference page is autogenerated. What is the source, if I > > am to update it? > > > > Log a ticket in Redmine with your updates.OK, having already registered on the wiki, I just tried to register on redmine and it''s returning an error. -- Bruce Hierophant: someone who remembers, when you are on the way down, everything you did to them on the way up. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Tue, Feb 24, 2009 at 11:26:53AM +0100, Peter Meier wrote:> > Hi > > >> would be nice if you could add this documentation to the wiki, > >> because... eh it''s a wiki! > > > > The functions reference page is autogenerated. What is the source, if I > > am to update it? > > the code. > > However for more extended example it might be nice to create wiki page. > But if it''s just a few lines, I think James is fine with code patches.I''ll submit a patch but it sounds like it might be a good idea to change the template for the function references page to include a link to /track/wiki/Function_Usage_Examples#functionname . I''d happily populate that page and then bug people to correct my mistakes and fill in the gaps. If nobody can suggest a better name, I''ll take some time to day to create that page in the hope that the links will appear later. -- Bruce I see a mouse. Where? There, on the stair. And its clumsy wooden footwear makes it easy to trap and kill. -- Harry Hill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---