On Dec 8, 1:07 pm, Jo Rhett <[email protected]> wrote:
> I've found some problems due to the extremely random ordering puppet does.  
> It is necessary for some of these items to all happen together, with no other 
> random resources executed in between.


That's rather unusual.  I'll discuss in a minute how you might address
this requirement, but are you sure you really need to do so?  Would
you care to satisfy my curiosity as to why?  Are you also going to
have a problem if some other process (that is, not the Puppet agent)
does any work between?


>  Is there some way to arrange this with puppet?


Puppet's resource model assumes that each resource is atomic.  If
multiple resources really must all be applied one after another, with
no others in between, then they oughtn't really to be modeled as
separate resources.  Rather, they are a single composite resource, and
the right way to handle the situation is therefore to write a custom
type (and provider) to handle the situation.

There is also a quick and dirty solution: use run stages.  Assign all
the resources that need to be applied consecutively to one run stage,
and make sure no others are assigned to it.  Or, if you cannot exclude
all other resources (since run stages work at class granularity) then
use explicit resource relationships to push other resources before or
behind the group as needed.  Be warned: doing this is likely to cause
you continuing grief with dependency cycles, even with classes not
unrelated to your resource group.  Also be aware that run stages are
an entry point to several of the problems attending use of
parameterized classes, even if the classes involved are not explicitly
parameterized.

In principle, you could also do this with ordinary resource
relationships.  That would keep you away from parameterized class
syntax, but it would be horendously messy.  I cannot possibly
recommend it except maybe if you have some kind of code generator
writing your manifests for you.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to