start-up tasks
To get the time, you can use -start-at-task to execute only the latest commands, which are probably the ones that are listening. But for this you must name your task:
This shell task has no name
- shell: vagrant provision; vagrant up; args: chdir: /vm/vagrant
It does:
- name: start vagrant shell: vagrant provision; vagrant up; args: chdir: /vm/vagrant
then do:
ansible-playbook playbook.yml --start-at-task="start vagrant"
tags
Another good tip is to use tags. For example, 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:
ansible-playbook playbook.yml --tags="debug"
And it will only launch tasks that received tag debugging.
Verbose
And if you need more information, you can ask Ansible to be more detailed using -v, -vv, -vvv or -vvvvv
ansible-playbook -vvvv playbook.yml --tags="debug"
This will tell you everything that can, for a given task.
source share