Hi I have a very simple set up node default { #declare classes for all nodes include baseline } node app inherits default { include appstuff } node web inherits default { iclude websutff } HOWEVER, I''m getting notification that node "web" is applying class appstuff how could something like that happen? Any advice? -- 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.
More details would help. This is not enough information to debug. “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- FirstName LastName <octomeow@gmail.com> wrote:> Hi > > I have a very simple set up > > node default { > #declare classes for all nodes > include baseline > } > node app inherits default { > include appstuff > } > > node web inherits default { > iclude websutff > } > > HOWEVER, I''m getting notification that node "web" is applying class appstuff > how could something like that happen? Any advice? > > -- > 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. >-- 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, Further to that, it is most likely going to be that you have either an include or import statement for the web class. Grep through your manifest and find out if you have included them in base or app stuff. Den On 16/03/2012, at 5:10, Dan White <ygor@comcast.net> wrote:> More details would help. > This is not enough information to debug. > > “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” > Bill Waterson (Calvin & Hobbes) > > ----- FirstName LastName <octomeow@gmail.com> wrote: >> Hi >> >> I have a very simple set up >> >> node default { >> #declare classes for all nodes >> include baseline >> } >> node app inherits default { >> include appstuff >> } >> >> node web inherits default { >> iclude websutff >> } >> >> HOWEVER, I''m getting notification that node "web" is applying class appstuff >> how could something like that happen? Any advice? >> >> -- >> 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. >> > > -- > 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. >-- 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.
Just a quick note, not strictly related to your question Be careful when including classes with nodes'' inheritance: if you set a variable, for example, in the node "web" that is used by classes included in the baseline class, that variable'' value will be ignored. It''s a typical "variables scoping issue" that has contributed to the bad reputation of the nodes'' inheritance layout. My rule of thumb is: Use node''s inheritance ONLY to set and override variables, and include classes ONLY at the $hostname node level (at the ned of the inheritance tree) To avoid duplications you case still include webstuff there and in the webstaff class "include baseline". Sadly this whole nodes'' inheritance use to dynamically override variables will break in the next version of Puppet. ( for more info http://docs.puppetlabs.com/guides/scope_and_puppet.html ) al On Thursday, March 15, 2012 6:13:33 PM UTC+1, octomeow wrote:> > Hi > > I have a very simple set up > > node default { > #declare classes for all nodes > include baseline > } > node app inherits default { > include appstuff > } > > node web inherits default { > iclude websutff > } > > HOWEVER, I''m getting notification that node "web" is applying class > appstuff > how could something like that happen? Any advice? >-- 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/-/Z9PxTd-qFp4J. 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 3/19/12 3:55 PM, Alessandro Franceschi wrote:> Just a quick note, not strictly related to your question > Be careful when including classes with nodes'' inheritance: if you set a > variable, for example, in the node "web" that is used by classes > included in the baseline class, that variable'' value will be ignored. > It''s a typical "variables scoping issue" that has contributed to the bad > reputation of the nodes'' inheritance layout. > > My rule of thumb is: > Use node''s inheritance ONLY to set and override variables, and include > classes ONLY at the $hostname node level (at the ned of the inheritance > tree) > To avoid duplications you case still include webstuff there and in the > webstaff class "include baseline". > > Sadly this whole nodes'' inheritance use to dynamically override > variables will break in the next version of Puppet. > ( for more info http://docs.puppetlabs.com/guides/scope_and_puppet.html ) > > al > > On Thursday, March 15, 2012 6:13:33 PM UTC+1, octomeow wrote: > > Hi > > I have a very simple set up > > node default { > #declare classes for all nodes > include baseline > } > node app inherits default { > include appstuff > } > > node web inherits default { > iclude websutff > } > > HOWEVER, I''m getting notification that node "web" is applying class > appstuff > how could something like that happen? Any advice? >I would strongly encourage you to never use inheritance with nodes and only to use inheritance within a given module[1]. Instead of node default { include baseline } node app inherits default { include appstuff } I would recommend node default {} node app { include baseline # though, I recommend this is named ''common'' include appstuff } [1] - http://docs.puppetlabs.com/guides/style_guide.html#class-inheritance -g -- Garrett Honeycutt 206.414.8658 http://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.
Let me disagree :-) Actually I found the nodes'' inheritance model an easy to grasp, mantain and manage way to set and override variables according to whatever grouping logic. I''ve used it for almost 5 years, in several different Puppet setups of different scales and it has always fit well. * Given the precautions to use it ONLY to set and override variables and not to include classes. * I''m definitively disappointed that I won''t be able to use it in the next Puppet version and I''m still struggling to find a decent alternative (suggestions?). Hiera can be an alternative, and will probably be the "right thing" when is incorporated in the next version, but it has its own cons, imho. my2c al On Tuesday, March 20, 2012 3:57:17 PM UTC+1, Garrett Honeycutt wrote:> > On 3/19/12 3:55 PM, Alessandro Franceschi wrote: > > Just a quick note, not strictly related to your question > > Be careful when including classes with nodes'' inheritance: if you set a > > variable, for example, in the node "web" that is used by classes > > included in the baseline class, that variable'' value will be ignored. > > It''s a typical "variables scoping issue" that has contributed to the bad > > reputation of the nodes'' inheritance layout. > > > > My rule of thumb is: > > Use node''s inheritance ONLY to set and override variables, and include > > classes ONLY at the $hostname node level (at the ned of the inheritance > > tree) > > To avoid duplications you case still include webstuff there and in the > > webstaff class "include baseline". > > > > Sadly this whole nodes'' inheritance use to dynamically override > > variables will break in the next version of Puppet. > > ( for more info http://docs.puppetlabs.com/guides/scope_and_puppet.html) > > > > al > > > > On Thursday, March 15, 2012 6:13:33 PM UTC+1, octomeow wrote: > > > > Hi > > > > I have a very simple set up > > > > node default { > > #declare classes for all nodes > > include baseline > > } > > node app inherits default { > > include appstuff > > } > > > > node web inherits default { > > iclude websutff > > } > > > > HOWEVER, I''m getting notification that node "web" is applying class > > appstuff > > how could something like that happen? Any advice? > > > > I would strongly encourage you to never use inheritance with nodes and > only to use inheritance within a given module[1]. > > Instead of > > node default { > include baseline > } > node app inherits default { > include appstuff > } > > I would recommend > > node default {} > node app { > include baseline # though, I recommend this is named ''common'' > include appstuff > } > > [1] - http://docs.puppetlabs.com/guides/style_guide.html#class-inheritance > > -g > > -- > Garrett Honeycutt > > 206.414.8658 > http://puppetlabs.com > >-- 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/-/M8Kh-U1ZUUQJ. 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 Mar 20, 9:57 am, Garrett Honeycutt <garr...@puppetlabs.com> wrote:> I would strongly encourage you to never use inheritance with nodes and > only to use inheritance within a given module[1]. > > Instead of > > node default { > include baseline} > > node app inherits default { > include appstuff > > } > > I would recommend > > node default {} > node app { > include baseline # though, I recommend this is named ''common'' > include appstuff > > } > > [1] -http://docs.puppetlabs.com/guides/style_guide.html#class-inheritanceWould you care to explain the reasons for that recommendation? I acknowledge that it''s easy to overdo node inheritance, but it works fine and has some good use cases. I do typically recommend keeping node inheritance trees very shallow (two levels, or at most three), but I''ve never noticed any general sentiment disfavoring its use altogether. Class inheritance is a completely different beast. Its appropriate uses are few (though they do exist), and people seem much more inclined to get themselves in trouble there than with node inheritance. 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.