Forgot to mention that the reason what the above doesn't work is because 
the `rescue` tasks are executed only after _all_ the hosts have finished 
executing the task

On Monday, November 13, 2017 at 3:49:01 PM UTC-7, Ivo Jimenez wrote:
>
> I've been trying to find a way of accomplishing this (what the subject 
> says). I thought on using blocks, for example:
>
>
> - block:
>   - name: run task
>     command: <my-command>
>     register: command_result
>     failed_when: command_result.changed
>   rescue:
>   - name: stop task on all other nodes
>     command: <stop-command>
>     delegate_to: '{{ item }}'
>     with_items: '{{ groups.all }}'
>
> Can you think of any other alternative?
>
> Thanks!
>

-- 
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/506289f0-e2bc-4ef4-8ad7-7b389fd0543d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to