Feature request: special case for * (star) tag

Hello,

If I repeat someone, please, point me in the right direction.

I’m not the only guy who wants pre_task and post_tasks to work like setup/teardown methods and run regardless of any specified tags. Here is the discussion: https://groups.google.com/forum/#!msg/ansible-project/VxD39ABi1z4/8wrjJn7mh74J

So my proposal is to have a special tag name - * (star) which will force a task to run regardless of specified tags. This will help to be more verbose, and will only affect tasks which were manually tagged with such tag.

Consider the example below:
aerospike.yml

This has been discussed in the past.

The solution proposed before is to make sure the tag in question gets tagged with a known tag, like “common”.

I’m definitely objecting to reuse of the wildcard pattern matching “*” (it would imply other patterns could be used), but we were worried in the past that “all” might exist in existing playbooks and did not want to damage backwards compatibility either.

A change in tag logic could potentially be potentially dangerous as what a play does in automation tomorrow could be very different after an upgrade.

I think your proposal might be interesting if it was treated as an fnmatch pattern, but tags do not work this way, because what they do is affix a tag to the task, and then the system looks through and sees if any tags match the input.

Thus we are technically able to see what all the tags used in a playbook are, and specifying --tags thisIsATypo can actually tell you that the tag was named something else.

This becomes problematic when tags are fnmatch expressions, because then technically the playbook would support any kind of tag.

So the solution of tagging those steps “common” is a good one, because you can run multiple tags at the same time

–tags “common,app_config”, etc.

We could possibly consider making the word “all” magic. Though perhaps it should be something a bit safer like “tags: ignore”, in case all was in use.