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

Hi all,

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

hosts
[sm]
host1

[sw]
host2

myplaybook.yml

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

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.

--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).

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.

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.

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

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.

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.