On Feb 17, 2:56 am, "robert.gstoehl" <robert.gsto...@gmail.com> wrote:
> Can one include muliple parts of a (class) - inheritance chain? And if
> yes, how does this chain get traversed? Are there any limitations /
> sideffects / documentation?

You can include classes from multiple parts of an inheritance tree,
including classes from different branches of the tree, provided that
there are no conflicting overrides. Two overrides conflict if they
attempt to set different values for the same resource property, and
they occur in two classes where neither is a descendant of the other.

The two overrides in your "syslog" and "ueber_syslog" classes are
perfect examples of conflicting overrides.  I see nothing wrong with
your classes individually, but including both "syslog" and
"ueber_syslog" on the same node will fail.  That makes sense, because
doing so declares that the syslog service must be both running and
stopped, which is impossible.  There is no problem, however, with
including class "base" along with either one of the other two.

The solution, quite simply, is to avoid declaring conflicting
resources or resource properties.  In the example, that means each
node may include at most one of the "syslog" and "ueber_syslog"
classes.  To achieve that you can hard-code per node group which class
to use, use "if" or "case" statements to choose one class for each
node based on its available facts, or use an external node classifier.

Cheers,

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-us...@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