14/11/2015

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 and this is my "lite" technical blog!

I'm a passionate DevOps engineer, Cloud/Kubernetes specialist, Free/Open source geek, and an author.

I believe in self CI/CD (Continuous Improvements/Development), also that "the whole is greater than the sum of its parts".

DevOps transformation, automation, data, and metrics are my preferred areas. And I like to help both businesses and people to grow.

Contact Me

Name

Email *

Message *

Latest Post

DevOps is not only a culture - Discussion Panel

Today is my second session JobStack 2023 after my previous one yesterday titled " Platform Engineering: Manage your infrastructure u...

Popular Posts

Blog Archive