Hey Mark, I don't think there is a work-around for this.
However, the "Subject:" line is broken. There are no "static includes".
Includes are dynamic, full stop.
Likewise in your second sentence: "I don't want to choose between
dynamic and static imports." There are no dynamic imports, only static
imports.
Anyway, you aren't alone. Nobody wants to choose between dynamic
includes and static imports. But we have to.
Honestly, I agree with you. The array of unexpected behaviors
surrounding includes vs. imports, especially wrt tags, is a terrible
weaknesses. Newbies never get it right, which in my opinion is a fairly
strong indication that the feature is misdesigned.
The documentation explaining imports vs includes wrt tags has improved
tremendously over the last couple of years. It currently says at one
point, "[U]sing both includes and imports in a single playbook can lead
to difficult-to-diagnose bugs." but it doesn't give any examples, in
part probably because difficult-to-diagnose bugs are also
difficult-to-explain bugs. All things considered, stopping at saying
"combining these two parallel misdesigned features is a bad idea" is
sufficient, so I'll give them a pass on not explaining what can go wrong.
It's unfortunate that --list-tasks and --list-tags don't work for all
cases. But if the tool itself can't explain what to expect, it's not
surprising users have a hard time finding the right incantations.
On 12/1/22 4:35 PM, Mark Faine wrote:
This is a terrible weakness in Ansible for me. I don't want to
choose between dynamic and static imports. I want to be able to do both.
I want to be able to use features like --list-tasks and --list-tags
but I also want to be able to selectively run tagged tasks within a
role. Has anyone come up with a workaround?
--
You received this message because you are subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/17c7c49a-8eb4-3117-e828-ce85edaa1a05%40gmail.com.