On Friday, November 1, 2013 4:16:29 PM UTC-5, Tom Noonan wrote:
>
> That looks like a good solution, thanks! 
>
>

If by "good" you mean "quick and dirty" then you are right.  Relying on 
ensure_packages() and especially ensure_resource() may get you in trouble, 
however, and at minimum doing so carries an ongoing maintenance burden that 
better alternatives avoid.  They are fundamentally the wrong solution, 
because the simple fact that two independent, nonexclusive classes or 
modules both rely on the same resource demonstrates that the resource 
doesn't properly belong to either one of them.  The correct solution, 
therefore, is to factor out such resources into separate classes / modules.

The ensure_*() functions are encumbered by at least these issues:

   - they only solve the problem if they are applied to *every* declaration 
   of the resources they guard
   - they destabilize the state of guarded resources(*) unless you are 
   careful to keep all the guarded resource declarations identical
   - resource and class parameter overrides may fail to have the expected 
   effect on resources that are guarded by ensure_*() functions
   
(*) The target resource state may change when you modify your manifest set, 
but otherwise will be stable from run to run.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/7238aaf7-08c2-42f5-859f-3cf204cfadf2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to