On Tuesday, July 10, 2012 1:39:58 PM UTC-5, Dave Anderson wrote:
>
> Hi 
>
> I have a resource that is slow to come into service and I have other 
> resources that are dependent on the service in order to be configured. I've 
> been searching for the "puppet way" to do this, but all the options I've 
> found don't seem optimal, so I'm assuming there is a better way that I'm 
> missing. 
>
> I have several instances, so I want puppet to kick them off in parallel. 
> And I want the reliant services to be configured as soon as possible when 
> the slow services are ready 
>

The Puppet agent is single-threaded, and it actively prevents multiple 
(Puppet) instances from running simultaneously.  The only way you can start 
multiple resources in parallel is if Puppet is used only to trigger an 
asynchronous startup.  Although that's doable, it's not very consistent 
with the Puppet resource model, because Puppet relies on knowing whether 
its attempts to synchronize a resource succeed.  To put it another way, 
Puppet resource synchronization is (assumed to be) atomic when viewed at 
the DSL level.

If you can model your group of slow resources so that together they look 
like a single resource to Puppet, then perhaps it would work out.  Such a 
construction cannot be done in Puppet DSL, but you can either write a 
script that you will wrap an an Exec resource, or you can have a go at 
writing a custom resource type.  Possibly you could use Puppet's Ruby DSL, 
but my intuition suggests that might be dangerous for this kind of task.
 

> So I don't really want to use long timeout/multiple retry because I 
> believe that won't be executed in parallel - and anyway, it's not a retry I 
> want, it's a wait 
>

Good, because Puppet assumes that waiting is what happens.  Or bad, because 
Puppet isn't going to sync multiple (Puppet) resources on the same node in 
parallel no matter what you do. 


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/q5xaacPWRIUJ.
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