# is it possible to tag all tasks in a role?

**URL:** <https://forum.ansible.com/t/is-it-possible-to-tag-all-tasks-in-a-role/23109>\
**Category:** Ansible Project\
**Created:** [November 26, 2016, 11:35pm UTC](https://forum.ansible.com/t/is-it-possible-to-tag-all-tasks-in-a-role/23109 "2016-11-26T23:35:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spike1](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@Spike1](https://forum.ansible.com/u/Spike1)\
**Post date:** [November 26, 2016, 11:35pm UTC](https://forum.ansible.com/t/is-it-possible-to-tag-all-tasks-in-a-role/23109/1 "2016-11-26T23:35:53Z")

</div>

Hi,

I’d like to be able to tag all tasks in a role, however I’m not seeing an option… tags are not allowed globally in tasks/main.yml and if I tag a role in the play all depended roles will be tagged too.

An option would be to make main.yml empty except for a task that includes the actual tasks and tag that, but that seems rather nasty.

Is there a way I can tag all the tasks in a given role, but not the tasks of depended roles without the include hack?

thanks,

Spike
