# How to run role with a particular tag in a playbook?

**URL:** <https://forum.ansible.com/t/how-to-run-role-with-a-particular-tag-in-a-playbook/21458>\
**Category:** Ansible Project\
**Created:** [May 17, 2016, 3:25pm UTC](https://forum.ansible.com/t/how-to-run-role-with-a-particular-tag-in-a-playbook/21458 "2016-05-17T15:25:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmitry\_Owl](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@Dmitry\_Owl](https://forum.ansible.com/u/Dmitry_Owl)\
**Post date:** [May 17, 2016, 3:25pm UTC](https://forum.ansible.com/t/how-to-run-role-with-a-particular-tag-in-a-playbook/21458/1 "2016-05-17T15:25:01Z")

</div>

```auto
Hello, I need to run role in a playbook with a particular tag, **without "--tags" option.** Something like this:

```

```auto

```

```auto

- hosts: somehost
  remote_user: someuser 
  roles:
    - { role: somerole, with-tags: 'sometag' }

I expect that role will run only with the tag "sometag".

```

```auto
This functionality exists? I read docs and can't find anything like my example above.

```

```auto

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [May 17, 2016, 5:36pm UTC](https://forum.ansible.com/t/how-to-run-role-with-a-particular-tag-in-a-playbook/21458/2 "2016-05-17T17:36:56Z")

</div>

I think you are looking this one:

- hosts: somehost  
remote\_user: someuser  
roles:
- { role: somerole, tags: ‘sometag’ }

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [May 17, 2016, 5:38pm UTC](https://forum.ansible.com/t/how-to-run-role-with-a-particular-tag-in-a-playbook/21458/3 "2016-05-17T17:38:03Z")

</div>

no, that will tag all tasks in the role with ‘sometag’. The functionality does not current exist to select a tag on role import.

---

<div class="post-metadata">

**Author:** ![Dmitry\_Owl](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@Dmitry\_Owl](https://forum.ansible.com/u/Dmitry_Owl)\
**Post date:** [May 18, 2016, 11:07pm UTC](https://forum.ansible.com/t/how-to-run-role-with-a-particular-tag-in-a-playbook/21458/4 "2016-05-18T23:07:36Z")

</div>

Thank you.
