# Run a single role in playbook

**URL:** <https://forum.ansible.com/t/run-a-single-role-in-playbook/17336>\
**Category:** Ansible Project\
**Created:** [January 21, 2015, 11:03am UTC](https://forum.ansible.com/t/run-a-single-role-in-playbook/17336 "2015-01-21T11:03:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Craft](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@Andrew\_Craft](https://forum.ansible.com/u/Andrew_Craft)\
**Post date:** [January 21, 2015, 11:03am UTC](https://forum.ansible.com/t/run-a-single-role-in-playbook/17336/1 "2015-01-21T11:03:34Z")

</div>

In the same way that you can use tags to target specific tasks in a large playbook, is it possible to filter by roles? Tags are useful but often find i am tagging all tasks in a role with same tag so i can run just those, would be nice if I could use roles in a similar way to filter as tags?

thanks

---

<div class="post-metadata">

**Author:** ![Pal\_Nilsen](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@Pal\_Nilsen](https://forum.ansible.com/u/Pal_Nilsen)\
**Post date:** [January 21, 2015, 11:18am UTC](https://forum.ansible.com/t/run-a-single-role-in-playbook/17336/2 "2015-01-21T11:18:54Z")

</div>

You could always create a separate file with something like:

`

---

<div class="post-metadata">

**Author:** ![junkmailtrapenator](https://avatars.discourse-cdn.com/v4/letter/j/c77e96/32.png) [@junkmailtrapenator](https://forum.ansible.com/u/junkmailtrapenator)\
**Post date:** [January 21, 2015, 12:37pm UTC](https://forum.ansible.com/t/run-a-single-role-in-playbook/17336/3 "2015-01-21T12:37:20Z")

</div>

You can [tag your role](http://docs.ansible.com/playbooks_tags.html) just like anything else. Doing so effectively runs the role as if every task inside the role has the tag.

`

```auto
roles:
  - role: myCoolRole,
    tags: tagsAreCool

```

`

---

<div class="post-metadata">

**Author:** ![Andrew\_Craft](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@Andrew\_Craft](https://forum.ansible.com/u/Andrew_Craft)\
**Post date:** [January 21, 2015, 12:46pm UTC](https://forum.ansible.com/t/run-a-single-role-in-playbook/17336/4 "2015-01-21T12:46:03Z")

</div>

yep but have to go through and do it for each role and each playbook i want to that, would be nice if there was something like an implicit tag for each role.
