Proposal for fixing playbooks with dynamic include problems

Hi

I understand that task-level includes are completely dynamic in 2.0 and therefore the following command / option ( --list-tasks ) can
not list tasks in the task-level includes at parse time present in playbookfoo.yml :

ansible-playbook playbookfoo.yml --list-tasks

However, I feel that it should at least list the task-level include filenames when using option --list-tasks to indicate
that there may or may not be further tasks at runtime. This could provide a better idea of what is actually going
on at ansible-playbook runtime. Of course, this depends strongly on how meaningful the task-level include filenames are.

Phonthip Namkaew

Also, the start and step feature is effected by the static/dynamic loading http://docs.ansible.com/ansible/playbooks_startnstep.html

So many things are broken with Ansible’s notion of “composability” that it’s hard to know where to begin. I think that’s because Ansible apparently doesn’t know whether it’s a programming language, a descriptor language, declarative, imperative, composable, etc.

Similar to real programming languages, Ansible could require a playbook to “import” (but not execute) all possible playbook names that might be executed by a dynamic include statement. And if a dynamic include attempts to execute a playbook that wasn’t imported, it would fail with an error. For what it’s worth, I personally am never in the position of including a playbook whose name I don’t know in advance.

So many things are broken with Ansible’s notion of “composability” that it’s hard to know where to begin.

https://github.com/ansible/proposals/pull/4