Hello All, I''m hoping to figure out how to use stages to reduce how many require statements are used in a particular module. I''m using the brief examples in the documentation as a reference but I can''t grep how to implement the staging. http://docs.puppetlabs.com/references/2.6.0/metaparameter.html#stage Let''s say I have three classes that I''ve separated my content into... class foo::pre {} class foo::deploy {} class foo::configure {} I would like to stage them such that pre occurs first, followed by deploy, finished by configure. The documentation suggests you create new stages as resources. Does this mean that in each class I create the stage resource like this example? class foo::pre { stage {pre: } } class foo::deploy { stage {deploy: } } class foo::configure { stage {configure: } } The documentation also suggests you use class parameters to specify your stage. It gives the example of class { foo: stage => pre}. Does this mean you must create the stages in a different class then you use to specify the stage? I got to this point and confused myself so I''m hoping one of you can clear me up. Thanks! --Ryan -- 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.
On Thu, Jul 29, 2010 at 9:45 AM, Ryan Y. Coleman <dudeinpa@gmail.com> wrote:> Hello All, I''m hoping to figure out how to use stages to reduce how many require statements are used in a particular module.I''m investigating run-stages as well. I haven''t sorted out a working example yet, but will report back as soon as I have more information about the issue. For what it''s worth, it does look like there''s a bug in 2.6.0 and 2.6.1rc1 with run-stages. Cheers, -- Jeff McCune http://www.puppetlabs.com/ -- 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.
On Thu, Jul 29, 2010 at 9:45 AM, Ryan Y. Coleman <dudeinpa@gmail.com> wrote:> > I would like to stage them such that pre occurs first, followed by deploy, finished by configure. > > The documentation suggests you create new stages as resources. Does this mean that in each class I create the stage resource like this example?The stages are resources like any other, which means they can only be declared in the catalog once. Otherwise, you''ll get duplicate declaration errors. I''d declare them in their own class included in the node classification. class runstages { stage { "pre": before => Stage["main"] } stage { "post": require => Stage["main"] } }> I got to this point and confused myself so I''m hoping one of you can clear me up. Thanks!Here''s the rest of my example: class one { notify { "class one, first stage": } } class two { notify { "class two, second stage": } } class three { notify { "class three, third stage": } } # JJM We need Stage[pre] and Stage[post] in the catalog include runstages # place Class[pre] in stage "pre" class { "one": stage => pre } # default Class[main] to stage "main" class { "two": } # place Class[post] in stage "post" class { "three": stage => post } -- Jeff McCune http://www.puppetlabs.com/ -- 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.
Jeff McCune wrote:> On Thu, Jul 29, 2010 at 9:45 AM, Ryan Y. Coleman <dudeinpa@gmail.com> wrote: >> I would like to stage them such that pre occurs first, followed by deploy, finished by configure. >> >> The documentation suggests you create new stages as resources. Does this mean that in each class I create the stage resource like this example? > > The stages are resources like any other, which means they can only be > declared in the catalog once. Otherwise, you''ll get duplicate > declaration errors.Jeff Fancy adding that to the Language Tutorial? James -- Puppet Labs - http://www.puppetlabs.com C: 503-734-8571 -- 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.
On Thu, Jul 29, 2010 at 4:33 PM, James Turnbull <james@puppetlabs.com> wrote:> Jeff > > Fancy adding that to the Language Tutorial? > > JamesDefinitely. I''ll update the documentation this evening. -- Jeff McCune http://www.puppetlabs.com/ -- 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.