Hi all, I''m really interested in new metaparameter "stage". I''ve been "studying" Ryan''s example: http://www.personal.psu.edu/ryc108/blogs/puppetmaster/2010/10/automating-shibboleth-idp-builds-using-stages.html and I was able to define and use stages in my catalogue. But now I''d like to improve my knowledge of this parameter and I have some questions about it: 1.-) Stage vs require Class. May we say that stages are groups of class requires? So a simple/basic example: class A { require class B } class B{ require class C } Is like defining : Stage[pre] -> Stage[main] -> Stage[post] class { A: stage => pre } class { B: stage => main } class { C: stage => post } 2.-) Metaparameter use. In Ryan''s example seems that "stage" is added to class when defining the node. But may I add "stage" directly when defining the class? if yes, how? (I have not been able to find the correct syntax... :-( ). Is this correct? class A { stage => pre file { ... } service { ... } } 3.-) Stage order. I had an "old syntax" order definiton which worked fine: class orden { - stage { ''repos'': - before => Stage[''main'']; - ''os'': - require => Stage[''repos'']; - ''basic'': - require => Stage[''os'']; - ''gLite'': - require => Stage[''basic'']; - ''post'': - require => Stage[''gLite'']; - } but when applying new syntax: Stage[pre] -> Stage[main] -> Stage[post] class orden { Stage[''repos''] -> Stage[''os''] -> Stage[''main''] -> Stage[''gLite''] -> Stage[''post''] } puppet complains: Could not find stage repos specified by Class[Sl5_computing_repos] ... am I forgetting something in my definiton? TIA, Arnau -- 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 Fri, Oct 15, 2010 at 12:19:36PM +0200, Arnau Bria wrote:> 1.-) Stage vs require Class. May we say that stages are groups of class > requires? So a simple/basic example: > > class A { > require class B > } > > class B{ > require class C > } > > Is like defining : > > Stage[pre] -> Stage[main] -> Stage[post] > > class { A: stage => pre } > class { B: stage => main } > class { C: stage => post }Is it the same? I haven''t investigated stages, but I don''t think it would be. In your first example, Class B will not be evaluated if any resource in class A fails. Is this true in the second example? I actually hope not; if it is true, stages have to be used very carefully indeed. -- Bruce What would Edward Woodward do? -- 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 Fri, Oct 15, 2010 at 4:46 PM, Bruce Richardson <itsbruce@workshy.org>wrote:> On Fri, Oct 15, 2010 at 12:19:36PM +0200, Arnau Bria wrote: > > 1.-) Stage vs require Class. May we say that stages are groups of class > > requires? So a simple/basic example: > > > > class A { > > require class B > > } > > > > class B{ > > require class C > > } > > > > Is like defining : > > > > Stage[pre] -> Stage[main] -> Stage[post] > > > > class { A: stage => pre } > > class { B: stage => main } > > class { C: stage => post } > > Is it the same? I haven''t investigated stages, but I don''t think it > would be. In your first example, Class B will not be evaluated if any > resource in class A fails. Is this true in the second example? I > actually hope not; if it is true, stages have to be used very carefully > indeed. > > -- > Bruce > > What would Edward Woodward do? > > -- > 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. > >Also, apart from what Bruce mentioned, as a simple example, if you want to update your repositories, say through apt-get update, then using stages is more easier than figuring out the appropriate class require or include statements (you can find a solution like this though in the mailing lists, probably better than using stages, I haven''t investigated). So, you can have a module be executed before the main stage, which just does apt-get update. Doing something similar through require <class> statements would be cumbersome IMO. My guess is that using both, stages and generic concepts according to the requirement makes sense. -- 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 Fri, 15 Oct 2010 17:54:17 +0530 Mohit Chawla wrote:> On Fri, Oct 15, 2010 at 4:46 PM, Bruce Richardson > <itsbruce@workshy.org>wrote: > > > On Fri, Oct 15, 2010 at 12:19:36PM +0200, Arnau Bria wrote: > > > 1.-) Stage vs require Class. May we say that stages are groups of > > > class requires? So a simple/basic example: > > > > > > class A { > > > require class B > > > } > > > > > > class B{ > > > require class C > > > } > > > > > > Is like defining : > > > > > > Stage[pre] -> Stage[main] -> Stage[post] > > > > > > class { A: stage => pre } > > > class { B: stage => main } > > > class { C: stage => post } > > > > Is it the same? I haven''t investigated stages, but I don''t think it > > would be. In your first example, Class B will not be evaluated if > > any resource in class A fails. Is this true in the second > > example? I actually hope not; if it is true, stages have to be > > used very carefully indeed.that''s a good point.> Also, apart from what Bruce mentioned, as a simple example, if you > want to update your repositories, say through apt-get update, then > using stages is more easier than figuring out the appropriate class > require or include statements (you can find a solution like this > though in the mailing lists, probably better than using stages, I > haven''t investigated). So, you can have a module be executed before > the main stage, which just does apt-get update. Doing something > similar through require <class> statements would be cumbersome IMO.I completely agree on that point, and for that reason I''m asking about stages, for fully understanding them and use them appropriately. Stages can make our life really simple.> My guess is that using both, stages and generic concepts according to > the requirement makes sense.If you look at my OP and my stages, you''ll see that I first configure repos -> os -> main -> gLite(sutom software) -> post. But I also have some class require in "os" stage, i.e. Thanks for your replies, Arnau -- 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.
> 3.-) Stage order. > > but when applying new syntax: > > class orden { > Stage[''repos''] -> Stage[''os''] -> Stage[''main''] -> Stage[''gLite''] -> Stage[''post''] > }In your working example you define the classes and then enforce ordering at the same time. The new syntax references the stages but doesn''t actually define them, so you could do this: class orden { stage { [ ''repos'', ''os'', ''gLite'', ''post'' ]: } Stage[''repos''] -> Stage[''os''] -> Stage[''main''] -> Stage[''gLite''] -> Stage[''post''] } -Hunter Haugen -- 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 Mon, 18 Oct 2010 09:14:09 -0700 Hunter Haugen wrote: Hi, [...]> In your working example you define the classes and then enforce > ordering at the same time. The new syntax references the stages but > doesn''t actually define them, so you could do this:> class orden { > stage { [ ''repos'', ''os'', ''gLite'', ''post'' ]: } > Stage[''repos''] -> Stage[''os''] -> Stage[''main''] -> Stage[''gLite''] -> > Stage[''post''] > }> -Hunter Haugenthanks Hunter! -- 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 10/18/2010 6:14 PM, Hunter Haugen wrote:> so you could do this: > > class orden { > stage { [ ''repos'', ''os'', ''gLite'', ''post'' ]: } > Stage[''repos''] -> Stage[''os''] -> Stage[''main''] -> Stage[''gLite''] -> > Stage[''post''] > }A style question: wouldn''t it be preferable to write it like this: class orden { stage { ''repos'': } -> stage { ''os'': } -> stage { ''main'': } -> stage { ''gLite'': } -> stage { ''post'': } } Best Regards, David -- dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at Klosterneuburg UID: ATU64260999 FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg -- 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.
My 2cents, Why not use the stdlib that puppet provides. It contains the following stage presets, class stdlib::stages { stage { ''setup'': before => Stage[''main''] } stage { ''runtime'': require => Stage[''main''] } -> stage { ''setup_infra'': } -> stage { ''deploy_infra'': } -> stage { ''setup_app'': } -> stage { ''deploy_app'': } -> stage { ''deploy'': } } I''m going to start using this going forward. On Wednesday, 20 October 2010 12:48:47 UTC+2, David Schmitt wrote:> > On 10/18/2010 6:14 PM, Hunter Haugen wrote: > > so you could do this: > > > > class orden { > > stage { [ ''repos'', ''os'', ''gLite'', ''post'' ]: } > > Stage[''repos''] -> Stage[''os''] -> Stage[''main''] -> Stage[''gLite''] -> > > Stage[''post''] > > } > > A style question: wouldn''t it be preferable to write it like this: > > class orden { > stage { ''repos'': } -> stage { ''os'': } -> stage { ''main'': } -> stage > { ''gLite'': } -> stage { ''post'': } > } > > > Best Regards, David > -- > dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at > Klosterneuburg UID: ATU64260999 > > FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/N8wgSj8I07AJ. 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.