On 13/12/17 14:46, Tobias Koeck wrote:
Hi,
I am wondering what the difference between a Resource Default statement like
|Exec { path => '/usr/bin:/bin:/usr/sbin:/sbin', environment =>
'RUBYLIB=/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0/', logoutput =>
true, timeout => 180, }
What the others said is not quite accurate.
This sets the defaults for all Exec resources that are declared in the
same scope, or in any scope that is included from this scope. This is
known as Dynamic Scoping and it is a horribly bad idea that is removed
from modern puppet for everything except Resource Defaults (what the
example construct is known as). The less you use this the better.
using a per block default like described in
https://puppet.com/docs/puppet/5.3/lang_data_default.html#per-block-resource-defaults
Others correctly pointed out that this is a local defaults only.
Use this if you can as you do not risk unintentionally changing the
defaults for code that appears to be far away from yours.
Best,
- henrik
--
Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/p0rh4c%24p3p%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.