top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Does Ansible provide any option to start from a particular task of a playbook ?

0 votes
301 views

A playbook may consist of multiple tasks and as per my understanding it runs from top to bottom. Is there any way to start execution from a task other than first one ? If yes then what is the way to do that ?

posted Apr 30, 2017 by Vikram Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Hi Vikram,
You are correct, normally playbook execution starts from top and goes to bottom but Ansible provides very useful options which can be used. While running playbook you can use the following option to run tasks from a specific path:

$ansible-playbook playbook.yml --start-at-task="install packages"

Reference:
http://docs.ansible.com/ansible/playbooks_startnstep.html

answer May 1, 2017 by Harshita
Thanks a lot.
Similar Questions
0 votes

There is a possibility on one controller multiple people are working and all of them have login credentials of controller node. Assume someone is editing one playbook but he/she does not let others to see the changes. Is there any way in Ansible by which a user can stop others to edit/read the file ?

+1 vote

Is there any option to control execution of ansible playbook by mean of user interactive mode ? I mean before executing any task it prompts for the user input and based on user input it takes action to run or not.

+1 vote

What is Ansible and how does it work ?

...