# Play single roles in a playbook

**URL:** <https://forum.ansible.com/t/play-single-roles-in-a-playbook/20562>\
**Category:** Ansible Project\
**Created:** [February 12, 2016, 3:21pm UTC](https://forum.ansible.com/t/play-single-roles-in-a-playbook/20562 "2016-02-12T15:21:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniele\_Varrazzo](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@Daniele\_Varrazzo](https://forum.ansible.com/u/Daniele_Varrazzo)\
**Post date:** [February 12, 2016, 3:21pm UTC](https://forum.ansible.com/t/play-single-roles-in-a-playbook/20562/1 "2016-02-12T15:21:00Z")

</div>

Hello,

All my playbooks looks like:

- hosts: web\_servers  
roles:
- role: nginx  
tags: nginx
- role: web\_landing  
tags: web\_landing
- role: web\_server  
tags: web\_server

because I want to be able to deploy only a certain role or subset of roles sometimes: because I’m developing on these, because a playbook may be huge and people know what bit are to be deployed and so on. And the only way I’ve found to run only a subset of the playbook is to use tags.

Is there any command-line parameter or other options I’m missing in order to deploy only certain roles in a playbook, without abusing tags?

Thank you very much!

– Daniele

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 12, 2016, 3:37pm UTC](https://forum.ansible.com/t/play-single-roles-in-a-playbook/20562/2 "2016-02-12T15:37:27Z")

</div>

What is the problem with using tags? We tag every role. At the moment, we have 65 tags aggregated across site.yml.

tags are designed specifically for this functionality.

---

<div class="post-metadata">

**Author:** ![Daniele\_Varrazzo](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@Daniele\_Varrazzo](https://forum.ansible.com/u/Daniele_Varrazzo)\
**Post date:** [February 12, 2016, 3:46pm UTC](https://forum.ansible.com/t/play-single-roles-in-a-playbook/20562/3 "2016-02-12T15:46:32Z")

</div>

> What is the problem with using tags? We tag every role. At the moment, we have 65 tags aggregated across site.yml.
> 
> tags are designed specifically for this functionality.

Sure tags work, that’s why I use them. But this need of creating 1-1 tags for roles smells like something missing to me (missing as ansible feature or just from my knowledge).

– Daniele

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [February 12, 2016, 4:15pm UTC](https://forum.ansible.com/t/play-single-roles-in-a-playbook/20562/4 "2016-02-12T16:15:10Z")

</div>

It would be nice if roles could be autotagged with the role name.
