Brilliant! Works perfectly! Thank you so much. :)

On Friday, October 5, 2018 at 3:01:25 PM UTC-7, Kai Stian Olstad wrote:
>
> On 05.10.2018 22:59, bglowacki wrote: 
> > What I would like is to be able to specify 5 agents "at a time," 
> > meaning 
> > that, when one of the 5 agents finishes with the patching play, it will 
> > automatically start the play against another agent - always keeping the 
> > maximum number of agents getting patched at any give time to be 5. That 
> > way, if one agent is blocked for 8 hours, the remaining 4 slots can be 
> > used 
> > to cycle through the remaining build agents - and so on. 
> > 
> > Is there some combination of the serial/forks options that would 
> > provide me 
> > this kind of capability - or am I asking for a new feature enhancement? 
>
> This is not possible with Ansible itself, you have strategy: free, but 
> it still wait for all hosts in the serial batch to finished before 
> moving to next set of hosts. 
>
> What you can do is use parallel or xargs to accomplish this. 
> This will run 5 ansible-playbook in parallel, each ansible-playbook is 
> limited to one host. 
>
>    ansible-playbook playbook.yml --list-hosts | sed -e '1,/hosts/d' -e 
> 's/^ *//' | xargs -P5 -n1 ansible-playbook playbook.yml --limit 
>
> This would only work well if you don't need to type in passwords. 
>
> -- 
> Kai Stian Olstad 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/74feaae4-a680-4ed7-91aa-c925cd89f08f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to