Lets say I have this for an external node: classes: software::application environment: production parameters: appvar1: appkey1 ... appvarN: appkeyN The software::application class can access the appvarN variables. I keep seeing people here say stuff like ''oh just move it up into a class''. Well, if I move the parameter definitions out of the node and up into another class like this: classes: software::application software::application_parameters environment: production parameters: then the software::application class CANNOT access the appvarN variables. What made initially think about this is that we are running 10 or more instances of a specific application on a server, and need to set up to 50 variables for each instance. For tidyness, I was hoping that each instance could be split into a separate file and the puppetmaster supported a file include function. Looks like it doesn''t. This made me think of simply putting each instance into it''s own class, but then of course they go out of scope. Puppet scoping issues strike again! How can I do this? Doug. -- 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.
Not an expert at all but... - I would try to get the instances of a same application done using definitions, not classes. - extlookup would be a "a file include function" that would work (and I think it would work nicely with definitions, but no direct experience) - Wouldnt it be more logical to include software::application_parameters inside software::application? On Sun, Aug 22, 2010 at 4:15 AM, Douglas Garstang <doug.garstang@gmail.com>wrote:> Lets say I have this for an external node: > > classes: > software::application > environment: production > parameters: > appvar1: appkey1 > ... > appvarN: appkeyN > > The software::application class can access the appvarN variables. I > keep seeing people here say stuff like ''oh just move it up into a > class''. Well, if I move the parameter definitions out of the node and > up into another class like this: > > classes: > software::application > software::application_parameters > environment: production > parameters: > > then the software::application class CANNOT access the appvarN > variables. What made initially think about this is that we are running > 10 or more instances of a specific application on a server, and need > to set up to 50 variables for each instance. For tidyness, I was > hoping that each instance could be split into a separate file and the > puppetmaster supported a file include function. Looks like it doesn''t. > This made me think of simply putting each instance into it''s own > class, but then of course they go out of scope. Puppet scoping issues > strike again! > > How can I do this? > > Doug. > > -- > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- ------------------------------ Jesús Couto F. -- 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, Aug 23, 2010 at 2:23 AM, Jesús Couto <jesus.couto@gmail.com> wrote:> Not an expert at all but... > > - I would try to get the instances of a same application done using > definitions, not classes.You can''t use definitions in external nodes.> - extlookup would be a "a file include function" that would work (and I > think it would work nicely with definitions, but no direct experience)Works nicely most places.> - Wouldnt it be more logical to include software::application_parameters > inside software::application?No, not really. I want to keep it in the external node yaml file so that it''s not hidden way up there in the module somewhere. Not very maintainable like that, and it''s not machine readable/writable. -- 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 Sat, Aug 21, 2010 at 7:15 PM, Douglas Garstang <doug.garstang@gmail.com> wrote:> > How can I do this?class software::application { $appvarN = $::software::application_parameters::appvarN } However, if you actually want to set the values externally, you''re probably better off setting them in your external node classifier. -- Jeff McCune http://www.puppetlabs.com/ -- 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.