On Fri, Aug 05, 2011 at 06:33:12AM -0700, Nigel Kersten wrote:
> We have a bunch of problems people regularly run into with node inheritance,
> and it's something we'd like to find a better solution for.
> 
> Is anyone using node inheritance and happy with how it works? If so, can you
> describe your setup briefly?

I use node inheritance purely for setting variables that are relevant to
environments or roles.  So I'll have a production node or a staging node
and the host node may inherit from that, or from a "production webservers" node
which inherits from production.  I give all the role and environement
based nodes names ending in ".template" to avoid potential name clashes.

I use class inheritance for all the configuration and include classes in
the actual host node.  I use role-based classes to tie things together
and minimise the number of classes.  I make sure we never, ever include
a class in anything except the host node (not in any of the template
nodes from which it inherits), so that we always have the option to
override default values etc. without having to specially design our
classes for every eventuality.

So I'll have a webservers "role" class.  This gives me things like

node web01 inherits webserver.production.template {
        enabled_sites = [ 'test', 'sample', 'whatever' ]
        include webserver
}

This is the only way I have found to make puppet work for me
practically.  I don't like it much, but it works.  The inheritance model
is, without question, my absolute least favourite thing about Puppet.
Most hated thing, to be accurate.  I hate having to specify things at
the node level when the only things declared at the node level should be
the things which are *unique* to the node.  I don't much like having to
have parallel node and class inheritance.

A more traditional inheritance model would be much more useful for both
nodes and classes.  Oh, and as said by somebody else already, I have
always considered nodes to be a redundant duplication.  Nodes are just a
special case of classes and only serve to complicate Puppet's structure.
I appreciate the practical reasons why they were used in the first
place, but I think Puppet would benefit from scrapping nodes and
implementing a better inheritance model for classes.  I appreciate
that's quite something of a redesign and would make optimisation more
difficult (at lest, starting from where we are now).

-- 
Bruce

A problem shared brings the consolation that someone else is now
feeling as miserable as you.

-- 
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