# Different hosts inside a role (is it doable, or am i thibking it wrong ?)

**URL:** <https://forum.ansible.com/t/different-hosts-inside-a-role-is-it-doable-or-am-i-thibking-it-wrong/16781>\
**Category:** Ansible Project\
**Created:** [November 14, 2014, 12:15am UTC](https://forum.ansible.com/t/different-hosts-inside-a-role-is-it-doable-or-am-i-thibking-it-wrong/16781 "2014-11-14T00:15:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_Comisario1](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Alejandro\_Comisario1](https://forum.ansible.com/u/Alejandro_Comisario1)\
**Post date:** [November 14, 2014, 12:15am UTC](https://forum.ansible.com/t/different-hosts-inside-a-role-is-it-doable-or-am-i-thibking-it-wrong/16781/1 "2014-11-14T00:15:23Z")

</div>

Hi guys, im having a role defined like this on my main playbook.yml, this role runs on the galera hosts :

- hosts: galera  
gather\_facts: True  
roles:
- { role: galera, tags: [‘galera’] }

The main.yml in the tasks directory of the role goes like this:

---

<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:** [November 14, 2014, 8:14pm UTC](https://forum.ansible.com/t/different-hosts-inside-a-role-is-it-doable-or-am-i-thibking-it-wrong/16781/2 "2014-11-14T20:14:03Z")

</div>

plays map hosts to tasks, not roles, you need another play.

---

<div class="post-metadata">

**Author:** ![Alejandro\_Comisario1](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@Alejandro\_Comisario1](https://forum.ansible.com/u/Alejandro_Comisario1)\
**Post date:** [November 15, 2014, 1:58pm UTC](https://forum.ansible.com/t/different-hosts-inside-a-role-is-it-doable-or-am-i-thibking-it-wrong/16781/3 "2014-11-15T13:58:34Z")

</div>

got it.  
thanks Brian
