On Jan 20, 3:00 am, Dan Bode <d...@puppetlabs.com> wrote:
> * the big reason I keep on leaning on it is for package dependencies. Often
> something needs an additional package installed (and it is possible that
> other modules may have that same package dependency, and I don't want to
> have to create a new class every time that I need another package
> (especially for something complicated that may have tons of package
> dependencies)


You describe one of the core use cases for virtual resources.  Instead
of relying on the defined() function, you can
1) define virtual Package resources in some central place(s) for all
the packages your nodes might want to manage,
2) include that class wherever needed, and
3) *realize* Packages as appropriate wherever you know you need
certain ones.

That avoids parse-order issues, doesn't require you to keep multiple
definitions of the same resource synchronized, and makes it easier to
find specific Package definitions among your manifests.  In some cases
you might even be able to leverage collections with selection
predicates to simplify and clarify your manifests.  I don't see a
single reason to prefer use of 'defined' for this case.


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