# Possible feature requrest: start execution at play number in a playbook

**URL:** <https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438>\
**Category:** Ansible Project\
**Created:** [June 8, 2015, 9:04pm UTC](https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438 "2015-06-08T21:04:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_Truong](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Steven\_Truong](https://forum.ansible.com/u/Steven_Truong)\
**Post date:** [June 8, 2015, 9:04pm UTC](https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438/1 "2015-06-08T21:04:21Z")

</div>

Hi all,

Please excuse for my ignorance if there is a clean way to do the following:

hosts  
[sm]  
host1

[sw]  
host2

myplaybook.yml

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 8, 2015, 9:05pm UTC](https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438/2 "2015-06-08T21:05:54Z")

</div>

We already have something, not play, but task based --start-at-task,  
also it uses the name not a number.

---

<div class="post-metadata">

**Author:** ![Steven\_Truong](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Steven\_Truong](https://forum.ansible.com/u/Steven_Truong)\
**Post date:** [June 8, 2015, 9:11pm UTC](https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438/3 "2015-06-08T21:11:15Z")

</div>

The problem here is that role1 is the first role for play #2 and play #3 but I want to start with play #3 and I do not want to edit or comment my playbook.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 8, 2015, 9:14pm UTC](https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438/4 "2015-06-08T21:14:17Z")

</div>

--list-tasks should show the tasks and their names, --start-at-task  
will then let you start at any task (does not matter if it was defined  
in a role a play or an include).

---

<div class="post-metadata">

**Author:** ![Steven\_Truong](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Steven\_Truong](https://forum.ansible.com/u/Steven_Truong)\
**Post date:** [June 8, 2015, 9:43pm UTC](https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438/5 "2015-06-08T21:43:25Z")

</div>

Hi Brian,

Please excuse me if I am wrong but the problem with using the same ordering and role name in plays is that unless you can provide a scope such as play#.task\_name then how do you apply a play preceded by another play with the same starting role. And there are times I have to apply the same role to different hosts according to some orders of execution and then I need to go back and fix things starting a play.

–list-tasks

play #2 (host1):  
setup abc  
…

play #3 (host3):  
setup abc  
…

If I used --start-at-task “setup abc” then how would I be able to achieve my goal as to start at play #3 and not play #2. Certainly Ansible can still apply all tasks in play #2 and that could be ok in some cases but when I want to save times or just to apply changes to hosts in starting at a specific play and avoid commenting out all previous plays up to the play I want to start with then would your suggestion work?

Thanks,  
Steven.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 8, 2015, 10:34pm UTC](https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438/6 "2015-06-08T22:34:40Z")

</div>

no, in that case there is nothing that will work w/o editing the  
playbook and introducing a 'checkpoint task' like debug: with a name  
you can use as reference.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 8, 2015, 10:35pm UTC](https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438/7 "2015-06-08T22:35:28Z")

</div>

actually at that point i would recommend just writing 1 off plays that  
do exactly what you want.

---

<div class="post-metadata">

**Author:** ![Steven\_Truong](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Steven\_Truong](https://forum.ansible.com/u/Steven_Truong)\
**Post date:** [June 8, 2015, 10:49pm UTC](https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438/8 "2015-06-08T22:49:42Z")

</div>

Hi Brian,

This has become a pain point (at least for me) when I have to deal with setup a full kerberized CDH 5.4 + hive + sentry setup. I certainly can break the playbook into playbooks but that might mean I would introduce even more playbooks in my environment and …

I just need to find a way to achieve this intelligently and without modifying my playbooks with comments and then I might forget to uncomment the plays or tasks.

Thanks for the conversation.  
Steven.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 8, 2015, 10:51pm UTC](https://forum.ansible.com/t/possible-feature-requrest-start-execution-at-play-number-in-a-playbook/18438/9 "2015-06-08T22:51:49Z")

</div>

i would propose smaller playbooks that do each group of tasks and a  
larger 'container' playbooks that run full stacks using includes: of  
the smaller ones.
