The closest I've come to this has been by using wait_for, but I'm not sure 
what the guarantees are here:


- local_action wait_for: path=/tmp/ansible.lock state=absent
// touch /tmp/ansible.lock
// perform task4/5
// delete /tmp/ansible.lock



If I run with --fork=5, isn't it possible that more than one fork will see 
the lock being absent at the same time and perform tasks 4/5 concurrently.


On Tuesday, November 25, 2014 3:10:39 PM UTC-5, Matt Hughes wrote:
>
> The only way I've seen to control the parallelism of a task is with the 
> --fork flag.  Is there any way to control this at the task level?  
>
> # First three tasks can occur fully concurrently
> - task 1
> - task 2
> - task 3
>
> # Then I want to perform this block one host at a time to perform a 
> rolling upgrade
> -task 4
> -task 5
>
>
>
> In my case, the first three tasks take a long time but are not a risk when 
> performing an upgrade.  Task 4/5 actually take services down so I want to 
> only perform them one host at a time.
>

-- 
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/999f94fd-f787-4af2-8832-9be746e1f352%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to