2014-11-15 22:01:25 +00:00
|
|
|
Start and Step
|
|
|
|
======================
|
|
|
|
|
2014-11-17 16:17:47 +00:00
|
|
|
This shows a few alternative ways to run playbooks. These modes are very useful for testing new plays or debugging.
|
2014-11-15 22:01:25 +00:00
|
|
|
|
|
|
|
|
2014-12-16 20:25:41 +00:00
|
|
|
.. _start_at_task:
|
2014-11-15 22:09:55 +00:00
|
|
|
|
2014-11-15 22:01:25 +00:00
|
|
|
Start-at-task
|
|
|
|
`````````````
|
2015-04-05 17:47:22 +00:00
|
|
|
If you want to start executing your playbook at a particular task, you can do so with the ``--start-at-task`` option::
|
2014-11-15 22:01:25 +00:00
|
|
|
|
2015-04-05 17:47:22 +00:00
|
|
|
ansible-playbook playbook.yml --start-at-task="install packages"
|
2014-11-15 22:01:25 +00:00
|
|
|
|
|
|
|
The above will start executing your playbook at a task named "install packages".
|
|
|
|
|
|
|
|
|
2014-12-16 20:25:41 +00:00
|
|
|
.. _step:
|
2014-11-15 22:09:55 +00:00
|
|
|
|
2014-11-15 22:01:25 +00:00
|
|
|
Step
|
|
|
|
````
|
|
|
|
|
|
|
|
Playbooks can also be executed interactively with ``--step``::
|
|
|
|
|
|
|
|
ansible-playbook playbook.yml --step
|
|
|
|
|
|
|
|
This will cause ansible to stop on each task, and ask if it should execute that task.
|
|
|
|
Say you had a task called "configure ssh", the playbook run will stop and ask::
|
|
|
|
|
|
|
|
Perform task: configure ssh (y/n/c):
|
|
|
|
|
|
|
|
Answering "y" will execute the task, answering "n" will skip the task, and answering "c"
|
|
|
|
will continue executing all the remaining tasks without asking.
|
|
|
|
|