On 01/25/2011 11:54 AM, Jan wrote:
> Hi all,
> 
> even though I've read some postings about run stages, I'm still having
> trouble using them correctly.
> 
> First of all: Is it possible to add a stage directly when defining a
> class? That question has already been asked here (in section 2):
> http://groups.google.com/group/puppet-users/browse_thread/thread/a4c9ee83039ddff3/3cfe92dd495f069a
> 
> If that wasn't possible, I've gathered from other threads, that I
> would have to add stages to my node definitions, like so:
> node ab_basenode {
>   include "baseconfig"
>   include "ab_baseconfig"
>   class { "afs": stage => first }
> }

Hi,

I won't pretend I understand your whole problem, but you obviosly try
and change a parameter (stage in this case) of a resource (here: class
afs) that has already been declared.

There are two ways that spring to mind.

1. Class inheritance:
Inherit the class that declares "class afs" in the first place. In the
subclass, just do
Class["afs"] { stage => first }
Then include the subclass in your node. Finished.

2. Exported Resources Override
(http://projects.puppetlabs.com/projects/1/wiki/Exported_Resources)
Instead of your above re-declaration of class afs, try
Class<| name == "afs" |> { stage => first }
This should do roughly the same as the class inheritance solution, minus
the class inheritance.
I try to avoid it, as it is convoluted and I don't really trust it ;-)

HTH,
Felix

-- 
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