start-at-task
To gain time, you can use --start-at-task to execute only the last comands which are probably those who are bugging. But for that you have to name your task :
This shell task has no name
- shell: vagrant provision; vagrant up;
args:
chdir: /vm/vagrant
This one does :
- name: start vagrant
shell: vagrant provision; vagrant up;
args:
chdir: /vm/vagrant
then run :
ansible-playbook playbook.yml --start-at-task="start vagrant"
tags
Another helpful tip is to use tags. For exemple you want to try only one command
- shell: vagrant provision; vagrant up;
args:
chdir: /linux/{{item.name}}
tags: [shell, debug]
Now you can debug this one doing :
ansible-playbook playbook.yml --tags="debug"
And it will start only tasks that received the tag debug.
Verbose
And if you want more informations, you can ask Ansible to be more verbose using -v, -vv, -vvv or -vvvvv
ansible-playbook -vvvv playbook.yml --tags="debug"
This will tell you all it can on the specified task