# Deprecation of "tags=" in include

**URL:** <https://forum.ansible.com/t/deprecation-of-tags-in-include/19708>\
**Category:** Ansible Project\
**Created:** [November 8, 2015, 6:17am UTC](https://forum.ansible.com/t/deprecation-of-tags-in-include/19708 "2015-11-08T06:17:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michel\_Blanc](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Michel\_Blanc](https://forum.ansible.com/u/Michel_Blanc)\
**Post date:** [November 8, 2015, 6:17am UTC](https://forum.ansible.com/t/deprecation-of-tags-in-include/19708/1 "2015-11-08T06:17:33Z")

</div>

Hi all,

Playing with 2.0, I just stumbled on:

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

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

myrole/tasks/main.yml:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- include: setup.yml tags=myrole,setup  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- 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

---

<div class="post-metadata">

**Author:** ![Ivan\_S\_Freitas](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@Ivan\_S\_Freitas](https://forum.ansible.com/u/Ivan_S_Freitas)\
**Post date:** [November 9, 2015, 4:25am UTC](https://forum.ansible.com/t/deprecation-of-tags-in-include/19708/2 "2015-11-09T04:25:56Z")

</div>

+1

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

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [November 9, 2015, 3:12pm UTC](https://forum.ansible.com/t/deprecation-of-tags-in-include/19708/3 "2015-11-09T15:12:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michel\_Blanc](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Michel\_Blanc](https://forum.ansible.com/u/Michel_Blanc)\
**Post date:** [November 9, 2015, 3:16pm UTC](https://forum.ansible.com/t/deprecation-of-tags-in-include/19708/4 "2015-11-09T15:16:07Z")

</div>

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

M
