On 12/14/2012 09:52 PM, Jakov Sosic wrote:
> Hi.
> 
> I am wondering why can't run stages get set inside the class?
> 
> For example:
> 
> class foo {
>   stage main
> }
> 
> Because, if I want to use stages, I have to declare my class as
> parametrized => so I can't use include or require anywhere else...
> 
> I thought of a different approach, like:
> 
> class foo_wrapper {
>   class{ 'foo': stage => 'somestage' }
> }
> 
> but would it work if I later include/require foo_wrapper in more than
> one place? And is this code ok?
> 
> 

OK, so it seems that stuff work when I declare it like this:

class foo {
  stage {'beforemain': before => Stage['main'] }
}

class foo::def::a {
  class { 'foo::classdef::a': stage => 'beforemain' }
}

class foo::def::b {
  class { 'foo::classdef::b': stage => 'beforemain' }
}

class foo::classdef::a {
  require foo::classdef::b
}

class foo::classdef::b {
}



I will try clean deploy of one of the systems to see if things break on
runtime, but this is surely very complex way of avoiding what seems to
be puppet limitation... It would be much easier if I could just set
stage somehow without wrapper class and resource-like declaration...

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to