llowder
2012-Nov-20 21:32 UTC
[Puppet Users] Question about a node that includes a class of the same name...
I was going through the open bugs and came across an interesting one[1], where if a node has a certain name, and includes a class of the same name, the class doesn''t get loaded. I did discover a workaround - two of them, actually. However, I was somewhat curious. Is this something people do? The example listed in the bug report was a node named ''centos'' and including a class named ''centos''. If this is a pattern you use (having a node and class name match) could you please let me know? Thanks. [1] http://projects.puppetlabs.com/issues/1372 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Uvu4fw3mKTAJ. 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.
KomodoDave
2012-Nov-21 06:33 UTC
[Puppet Users] Re: Question about a node that includes a class of the same name...
Instead of *"is this something you do"* should the question not instead be *"is this something that should break"*? Unless the nested resource has the same resource type and namevar as the outer resource, this seems like it *should* work. Dave On Tuesday, November 20, 2012 9:32:07 PM UTC, llowder wrote:> > I was going through the open bugs and came across an interesting one[1], > where if a node has a certain name, and includes a class of the same name, > the class doesn''t get loaded. > > I did discover a workaround - two of them, actually. > > However, I was somewhat curious. Is this something people do? > > The example listed in the bug report was a node named ''centos'' and > including a class named ''centos''. > > If this is a pattern you use (having a node and class name match) could > you please let me know? > > Thanks. > > > [1] http://projects.puppetlabs.com/issues/1372 >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/RzWI2xJqcg0J. 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-Nov-26 16:10 UTC
[Puppet Users] Re: Question about a node that includes a class of the same name...
On Tuesday, November 20, 2012 3:32:07 PM UTC-6, llowder wrote:> > I was going through the open bugs and came across an interesting one[1], > where if a node has a certain name, and includes a class of the same name, > the class doesn''t get loaded. > > I did discover a workaround - two of them, actually. > > However, I was somewhat curious. Is this something people do? >Some people do create "node classes", but as you can imagine, it doesn''t scale very well. Nevertheless, it shouldn''t break. I wonder whether you can work around the issue by using the absolute name of the class, like this: node ''centos'' { include ''::centos'' } Likewise, I wonder whether you can work around the issue of referencing class variables inside node blocks by referring to them via their absolute names. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/VYzZTpSOy8YJ. 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.
llowder
2012-Nov-26 16:33 UTC
[Puppet Users] Re: Question about a node that includes a class of the same name...
On Monday, November 26, 2012 10:10:06 AM UTC-6, jcbollinger wrote:> > > > On Tuesday, November 20, 2012 3:32:07 PM UTC-6, llowder wrote: >> >> I was going through the open bugs and came across an interesting one[1], >> where if a node has a certain name, and includes a class of the same name, >> the class doesn''t get loaded. >> >> I did discover a workaround - two of them, actually. >> >> However, I was somewhat curious. Is this something people do? >> > > > Some people do create "node classes", but as you can imagine, it doesn''t > scale very well. Nevertheless, it shouldn''t break. > > I wonder whether you can work around the issue by using the absolute name > of the class, like this: > > node ''centos'' { > include ''::centos'' > } > >I have found 2 ways to get around this. The first is to use a wild card regex as the node name: node /cento./{ include centos } And the other is to use paramater syntax, which works with "node centos" "node /centos/" and "node /cento./"> Likewise, I wonder whether you can work around the issue of referencing > class variables inside node blocks by referring to them via their absolute > names. > > > The class variables are only available in the node if the class itselfgets loaded. I put together a set of tests that show the different combinations, you can see them at https://gist.github.com/4090041> John > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Tg-1MWNlVSQJ. 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.