On 2012-01-12 24:25, Jakov Sosic wrote:
On 11/30/2012 11:48 PM, Johan De Wit wrote:
Thy both includes the class, but require adds a dependency to the
included class.
from the docs :
This function is a superset of the ‘include’ function, adding a class
relationship so that the requiring class depends on the required class.
Grts
What I was interested in is: Does the 'require' enforce order of
execution, so that the required class will be applied before the class
that requires it?
Yes.
require is basically shorthand for
class a {
include x
Class['x'] -> Class['a'] # x before a
}
If the require function makes things difficult, you can manage the
relationship using the ->, <-, <~, ~> operators, or as meta-parameters
in resources (i.e. require => Class['x']).
You can also look at Stages if you like to separate the concerns (some
classes should be after some other classes, but you do not want to
record the exact classes as you may want to change them).
You can create additional stages (there is a main stage by default), and
assign classes to stages.
See more here: http://docs.puppetlabs.com/guides/language_guide.html -
"Run Stages".
Hope that helps.
- henrik
--
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.