I understand how before, requires, etc work. I''m not quite so clear on stages. I have many modules I''ve created for various configuration items. My site.pp contains a class that simply includes them (some, based on facts). I have a default node that includes the class. That''s fine. However, I want to ensure there is some order. I realize if I did this in the classes, I would be letting some modules know about other modules. To me, that breaks the encapsulation I''ve gained with the modules (to some extent). What I''d like is to have "stages" and maybe the Puppet stages will work, but I am not sure yet. I can group my modules into 3 groups (or stages). Everything in the first stage must happen before the 2nd stage and then I wish to run the final stage. Can anyone tell me a good way to do this? Thanks, David -- 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.
I found this, which helps. I''m going to try something based on it. http://projects.puppetlabs.com/issues/5709 On Mon, Mar 14, 2011 at 4:29 PM, David Kavanagh <dkavanagh@gmail.com> wrote:> I understand how before, requires, etc work. I''m not quite so clear on > stages. > > I have many modules I''ve created for various configuration items. My > site.pp contains a class that simply includes them (some, based on facts). I > have a default node that includes the class. That''s fine. However, I want to > ensure there is some order. I realize if I did this in the classes, I would > be letting some modules know about other modules. To me, that breaks the > encapsulation I''ve gained with the modules (to some extent). > What I''d like is to have "stages" and maybe the Puppet stages will work, > but I am not sure yet. I can group my modules into 3 groups (or stages). > Everything in the first stage must happen before the 2nd stage and then I > wish to run the final stage. Can anyone tell me a good way to do this? > > Thanks, > David >-- 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, Mar 14, 2011 at 9:29 AM, David Kavanagh <dkavanagh@gmail.com> wrote:> I understand how before, requires, etc work. I''m not quite so clear on > stages. > I have many modules I''ve created for various configuration items. My site.pp > contains a class that simply includes them (some, based on facts). I have a > default node that includes the class. That''s fine. However, I want to ensure > there is some order. I realize if I did this in the classes, I would be > letting some modules know about other modules. To me, that breaks the > encapsulation I''ve gained with the modules (to some extent).Have you seen the newer relationship syntax? You can define relationships outside of the objects themselves, so you could do this in site.pp Class["a"] -> Class["b"] -> Class["c"] etc -- 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.
Here''s what I ended up with (with real stuff in the classes...) site.pp: stage { [ "pre", "post" ]: } Stage[''pre''] -> Stage[''main''] -> Stage[''post''] class first { ... } class second { ... } class third { ... } node default { class { ''first'': stage => pre } class { ''second'': stage => main } class { ''third'': stage => post } } On Tue, Mar 15, 2011 at 12:13 AM, Nigel Kersten <nigel@puppetlabs.com>wrote:> On Mon, Mar 14, 2011 at 9:29 AM, David Kavanagh <dkavanagh@gmail.com> > wrote: > > I understand how before, requires, etc work. I''m not quite so clear on > > stages. > > I have many modules I''ve created for various configuration items. My > site.pp > > contains a class that simply includes them (some, based on facts). I have > a > > default node that includes the class. That''s fine. However, I want to > ensure > > there is some order. I realize if I did this in the classes, I would be > > letting some modules know about other modules. To me, that breaks the > > encapsulation I''ve gained with the modules (to some extent). > > Have you seen the newer relationship syntax? You can define > relationships outside of the objects themselves, so you could do this > in site.pp > > Class["a"] -> Class["b"] -> Class["c"] > > etc >-- 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, Mar 14, 2011 at 5:31 PM, David Kavanagh <dkavanagh@gmail.com> wrote:> Here''s what I ended up with (with real stuff in the classes...)That definitely works too, and gives you a more flexible setup than my suggestion.> site.pp: > stage { [ "pre", "post" ]: } > Stage[''pre''] -> Stage[''main''] -> Stage[''post''] > class first { > ... > } > class second { > ... > } > class third { > ... > } > node default { > class { ''first'': stage => pre } > class { ''second'': stage => main } > class { ''third'': stage => post } > } > > On Tue, Mar 15, 2011 at 12:13 AM, Nigel Kersten <nigel@puppetlabs.com> > wrote: >> >> On Mon, Mar 14, 2011 at 9:29 AM, David Kavanagh <dkavanagh@gmail.com> >> wrote: >> > I understand how before, requires, etc work. I''m not quite so clear on >> > stages. >> > I have many modules I''ve created for various configuration items. My >> > site.pp >> > contains a class that simply includes them (some, based on facts). I >> > have a >> > default node that includes the class. That''s fine. However, I want to >> > ensure >> > there is some order. I realize if I did this in the classes, I would be >> > letting some modules know about other modules. To me, that breaks the >> > encapsulation I''ve gained with the modules (to some extent). >> >> Have you seen the newer relationship syntax? You can define >> relationships outside of the objects themselves, so you could do this >> in site.pp >> >> Class["a"] -> Class["b"] -> Class["c"] >> >> etc > >-- 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.