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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to