Can Ansible pause on errors, allowing user to intervene, then proceed?

40 views
Skip to first unread message

Neil Hooey

unread,
May 5, 2016, 5:36:02 PM5/5/16
to Ansible Project
When initially trying to get an elaborate playbook to work, it's very costly to repeat the process when a single task fails.

I'd like the playbook to automatically pause on a task that I haven't set `ignore_errors: True` on, let me manually do what the task intended to do, then let the playbook abort that particular task and continue. This way I can make an presumptive fix to the failing task, but let Ansible continue with the rest of the tasks, without having to re-run the playbook for every single error.

Are using `retry` files the right way to do this, or is there another way?

- Neil

Johannes Kastl

unread,
May 6, 2016, 3:41:31 AM5/6/16
to ansible...@googlegroups.com
On 05.05.16 23:36 Neil Hooey wrote:

> When initially trying to get an elaborate playbook to work, it's very
> costly to repeat the process when a single task fails.

> Are using `retry` files the right way to do this, or is there another way?

--start-at-task

https://docs.ansible.com/ansible/playbooks_startnstep.html

Johannes

signature.asc

Brian Coca

unread,
May 6, 2016, 10:05:40 AM5/6/16
to ansible...@googlegroups.com
You have a couple of options --step allows you to 'step through' each task, in 2.1 you also get the 'debug' strategy which is much closer to what you seem to want.


----------
Brian Coca

Neil Hooey

unread,
May 6, 2016, 1:42:47 PM5/6/16
to ansible...@googlegroups.com
Using `--start-at-task` won't work because it won't inherit the state from the beginning of the playbook. So facts that were set earlier will be undefined.

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/G2259BohHE0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/572C4A92.2010608%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.

Neil Hooey

unread,
May 6, 2016, 1:45:57 PM5/6/16
to ansible...@googlegroups.com
What happens when using `--step` and a task fails, does the whole playbook abort?

The debug strategy looks like the ideal solution. when is Ansible 2.1 going to be released to Pip?

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/G2259BohHE0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages