On Fri, 2012-08-03 at 22:43 -0700, Douglas Garstang wrote:
> Something that I have been confused about for a while.
> 
> If I have:
> 
> /etc/puppet/modules/foo/manifests/bar.pp:
> class foo::bar {
>     File {
>         backup => false
>     }
> }
> 
> /etc/puppet/manifests/site.pp:
> File { backup => true }
> 
> .... which one takes precedence in this situation? What about when an
> include or an inherit is used instead?

The puppet style guide:
http://docs.puppetlabs.com/guides/style_guide.html#resource-defaults
has a few words on this. As it turns out, the defaults follow dynamic
scope.

The end result will be that if a file {} resource is defined in class
foo:bar you'll get the defaults from foo:bar, and if a file {} resource
is declared outside of class foo:bar you'll get the defaults from the
top level.

It gets really complicated if you set resource defaults in a class, then
include another class from in that one; so don't do that.

-- 
Calvin Walton <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to