On Mar 21, 1:20 pm, Ashley Gould <ago...@ucop.edu> wrote:
> Please forgive my ignorance.  I find myself, a linux admin brought
> up on howtos and books with animals on the cover, suddenly plunged
> by puppet into a world of developers and computer scientists.  Could
> you explain what is "idempotency" and "support for multiple inclusion"?

Sorry, my bad.  The point is that you can include an ordinary class
multiple times on the same node (multiple inclusion), and the result
is exactly the same as if that class were included only once
(idempotency).  This can be important in a deep node inheritance
hierarchy, but it is more commonly important in situations where
classes include other classes.

For example, a common Puppet idiom is to create a "user" module
containing a "user::virtual" class in which virtual user resources are
declared for all system users.  Other classes then make decisions
about which users should actually be present on the system by
realizing subsets of those users (via Puppet's "realize" function or
<| |> syntax).  In my case, users are assigned to various research
groups, so I have a class for each group that realizes the users
associated with that group.  But those classes can only work if the
user::virtual class is included in the node's catalog.  It would be
possible to address that problem by ensuring that each node explicitly
includes "user::virtual", but that's clunky and subject to breakage.
Instead, it's better for each class that wants to realize users to
*itself* include user::virtual, which is possible and completely safe
provided that user::virtual is not parameterized.

Parameterized classes, on the other hand, can be included only once
per node, no matter what.  This is a substantial limitation on where
and how such classes can be used.

I hope that helps.


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