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?
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?
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 <calvin.walton@kepstin.ca>
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.