In 2.0.1, we're going to allow the use of any_errors_fatal at the block level, so you can simply do this:
- block: - task1: .. - task2: .. ... - taskN: .. rescue: - undo_taskN: .. ... - undo_task2: .. - undo_task1: .. any_errors_fatal: yes However, there is currently a bug in 2.0.0.x where any_errors_fatal is not working as stated in the documentation, so you'll have to wait until we get 2.0.1 out to do this. James Cammarata Director, Ansible Core Engineering github: jimi-c On Tue, Jan 19, 2016 at 4:33 AM, Dan C <[email protected]> wrote: > Hi there, > > I've been looking arround trying to find a way, with no luck. > > When running a playbook against multiple nodes (say 5), and one of them > fail a task (or block), I would like the other 4 nodes to run different > tasks than the ones they would run if non of the nodes fail. > > Is there any way to signal those nodes or to send them a variable which I > could use to choose the actions to be taken? > > The case of use is that if something fails in any host, I would like to > "undo" what I have already done... > > 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/2d3725bd-941a-440f-8d86-b85b8aa7f8c4%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/2d3725bd-941a-440f-8d86-b85b8aa7f8c4%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAMFyvFjr6YgWG7-k86uqZMb7b37frv%3DxiCzX4sESVfAX%3DFNKnA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
