Puppet will, by design, apply classes in a random order. To specify the order,
you want to use the "require" parameter.
exec { "echoone":
command => "/bin/echo $var1",
}
exec { "echotwo":
command => "/bin/echo $var2",
require => Exec['echoone'],
}
exec { "echothree":
command => "/bin/echo $var3",
require => Exec['echotwo'],
}
Stages are for when you want something to run before (or after) everything else.
On Dec 8, 2010, at 4:29 AM, sergey arlashin wrote:
> Hi!
> I'm trying to make puppet execute classes in a certain order for a
> particular node.
> So this is my test config:
>
> class one {
> exec { "echoone":
> command => "/bin/echo $var1",
> }
> }
>
> class two {
> exec { "echotwo":
> command => "/bin/echo $var2",
> }
> }
>
> class three {
> exec { "echothree":
> command => "/bin/echo $var3",
> }
> }
>
> node "client-tpl-puppet.localnet" {
> $var1 = "1"
> $var2 = "2"
> $var3 = "3"
> include one, two, three
> }
>
> But when I launch puppet client on the node "client-tpl-
> puppet.localnet" I see that all the classes execute in an absolutely
> random order. The documentation says I should use stages, but I cannot
> figure out how to use them in this particular case.
> Could you show an example?
>
> --
> 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.
>
--
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.