Deprecation of "tags=" in include

Hi all,

Playing with 2.0, I just stumbled on:

  [DEPRECATION WARNING]: You should not specify tags in the include
  parameters. All tags should be specified using the task-level option.
  This feature will be removed in a future release.

So, basically, this means that you cannot do this anymore:

myrole/tasks/main.yml:

      - include: setup.yml tags=myrole,setup
      - include: myrole.yml tags=myrole

This pattern is very handy: it lets you "assign" tags on all tasks in a
file. This helps keeping tasks descriptions less verbose, and improves
readability

If I understand the warning correctly, we won't be able to do that in
the future. What is the rationale behind the decision ? Will there be an
alternate way to do it (besides blocks) ?

Thanks,

M

+1

I'm also interested in this issue, as tagging includes is a core
practice in my workflow.

Tags are not being removed for includes, I just don’t want them to be considered part of the include arguments. In the future, tags should be specified on the task, just like all other tasks:

  • include: some_file.yml
    tags: foo

This makes things more consistent in general, and removes this one special case.

Indeed, it is much better with the new syntax.
Awesome, thanks James.

M