Say I'm debugging an Ansible playbook and want to quit after a given task (and not run through all of the following tasks). Is there any one-line magic command available, or do I have to manually create an exit/assert task?
From the ansible-playbook
manual, I see that there is a --start-at-task=START_AT
flag, but I don't see anything like an 'end-at' counterpart.
- meta: end_play
end_play
(added in 2.2) causes the play to end without failing the host.Using
- pause:
might suit.http://docs.ansible.com/pause_module.html
Or just a straight
- fail:
if you will certainly not want to continue.If you want a block of tasks to execute, you can use tags and
--with-tags:
. Ansible v2 will have proper code blocks so you can use a singlewhen:
for multiple tasks.ansible-playbook --step
will let you confirm each task you want to run and stop execution whenever you want.