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 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.
Try using "before" or "require" in your classes like so: class one { exec { "echoone": command => "/bin/echo $var1", before => Class["two"], } } class two { exec { "echotwo": command => "/bin/echo $var2", before => Class["three"], } } class three { exec { "echothree": command => "/bin/echo $var3", } } Best, Brandt -- J. Brandt Buckley Systems Integration Engineer CRBS brandt@ucsd.edu http://crbs.ucsd.edu M: +1 858 480 1010 F: +1 858 524 7497 Center for Research in Biological Systems University of California, San Diego 9500 Gilman Drive Basic Sciences Building #1000 La Jolla, Ca. 92093-0608 On Wed, Dec 8, 2010 at 4:29 AM, sergey arlashin <s.arlashin@gmail.com>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 puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > . > 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 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.
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 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. >-- 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.