Deprecation of "tags=" in include

290 views
Skip to first unread message

Michel Blanc

unread,
Nov 8, 2015, 1:17:43 AM11/8/15
to ansible...@googlegroups.com
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
--
Michel Blanc
{ :github => "@leucos", :twitter => "@b9m", :gpg => "0X24B35C22" }

Ivan S. Freitas

unread,
Nov 8, 2015, 11:26:03 PM11/8/15
to ansible...@googlegroups.com
+1

I'm also interested in this issue, as tagging includes is a core
practice in my workflow.
> --
> 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 ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/563EE8FD.4080105%40mbnet.fr.
> For more options, visit https://groups.google.com/d/optout.



--
Ivan Sichmann Freitas

James Cammarata

unread,
Nov 9, 2015, 10:13:03 AM11/9/15
to ansible...@googlegroups.com
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.


James Cammarata
Director, Ansible Core Engineering
github: jimi-c

Michel Blanc

unread,
Nov 9, 2015, 10:16:41 AM11/9/15
to ansible...@googlegroups.com
On 09/11/2015 16:12, James Cammarata wrote:
> 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.
Reply all
Reply to author
Forward
0 new messages