Run playbook starting of a certain task - Ansible

Most of the time when people test Ansible playbook or debugging it, I see them run the whole of playbook every time! But one of my preferred ways to do that is "Start and Step".

These options allow you to run playbooks from a certain part not from the start, they are very useful for testing new plays or debugging!

With "--start-at-task" you can start a playbook at a particular task, as following it will start from that task called "xTASK" regardless its place in playbook.
ansible-playbook playbook.yml --start-at-task="xTASK"
Other option is "--step", which will ask you before each task, and you can choose if you want to run this task or not.
ansible-playbook playbook.yml --step
Perform task: xTASK? (y/n/c):
You can use both of two options in the same time, so it will start from certain task and ask you if you want to run it or not.

One more thing, however "start-at-task" is really handy, unfortunately it become less important in complex playbooks! Because if this task depends on another previous tasks it will fail or skipped! But as usual, it's better to know than not!
Powered by Blogger.

Hello, my name is Ahmed AbouZaid, I'm a passionate Tech Lead DevOps Engineer. 👋

With 16+ years of open-source contributions, 12+ years of professional hands-on experience in DevOps, and an M.Sc. in Data Engineering from Edinburgh Napier University (UK), I enjoy facilitating the growth of both businesses and individuals.

I specialize in Cloud-Native and Kubernetes. I'm also a Free/Open source geek and book author. My favorite topics are DevOps transformation, automation, data, and metrics.

Contact Me


Email *

Message *

Start Your DevOps Engineer Journey!

Start Your DevOps Engineer Journey!
Start your DevOps career for free the Agile way in 2024 with the Dynamic DevOps Roadmap ⭐

Latest Post

2023 Highlights

Image generated with Craiyon . Finally, 2023 is over! What a year! One more crazy year, but it was the culmination ...

Popular Posts

Blog Archive