When writing and debugging Ansible playbooks, typical workflow is as follows:
ansible-playbook ./main.yaml
Take a look at http://docs.ansible.com/playbooks_startnstep.html.
If you want to start executing your playbook at a particular task, you can do so with the --start-at-task
option:
ansible-playbook playbook.yml --start-at-task="install packages"
The above will start executing your playbook at a task named “install packages”.
Alternatively, take a look at this previous answer How to run only one task in ansible playbook?
Finally, when a play fails, it usually gives you something along the lines of:
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/user/site.retry
Use that --limit
command and it should retry from the failed task.