On Monday, September 16, 2013 12:19:50 AM UTC-5, Rahul Khengare wrote:
>
> Hi Chengkai,
>     I have faced similar kind of problem for class ordering using ordering 
> arrow (*->)*. You can try the stage resources for ordering classes.
>
>

Run stages are indeed a mechanism for controlling application order of 
classes, but they are an awfully big and blunt hammer.  Indiscriminate use 
of stages is likely to get you into trouble.  Instead, you should fix the 
problem with your classes.
 

On Sunday, September 15, 2013 10:44:17 AM UTC+5:30, chengkai liang wrote:

> Hi All,
>>
>>    I have the following classes define:
>>
>>    init.pp
>>
>>       class { 'A': } ->
>>       class { 'B': } ->
>>       class { 'C': }
>>
>> Supposedly, the execution order should A then B then C, but the actual 
>> execution order seems that C is being executed before B.  Why is this 
>> happening?  Isn't -> will chain up the resources order?
>>
>>

Chances are that the chain operator works fine, but your expectation of 
what it means to apply (not execute) a class is flawed.  Problems of this 
kind are usually containment issues: when one class declares another, that 
does not inherently place any ordering relationship between the declared 
and declaring classes, nor are relationships between the declaring class 
and any resources or other classes directly relevant to the declared 
class.  This is quite different from the case of actual resources declared 
by a given class.  The distinction is intentional and necessary, but that's 
a separate topic.

As JuanBrein suggested, you can find more information about the issue and 
the most common solution, the "anchor" pattern, in the language docs.  
Here's a link: 
http://docs.puppetlabs.com/puppet/3/reference/lang_containment.html .


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to