# Ansible and complex hierarchy

**URL:** <https://forum.ansible.com/t/ansible-and-complex-hierarchy/15442>\
**Category:** Ansible Project\
**Created:** [June 11, 2014, 4:02pm UTC](https://forum.ansible.com/t/ansible-and-complex-hierarchy/15442 "2014-06-11T16:02:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreub](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@andreub](https://forum.ansible.com/u/andreub)\
**Post date:** [June 11, 2014, 4:02pm UTC](https://forum.ansible.com/t/ansible-and-complex-hierarchy/15442/1 "2014-06-11T16:02:47Z")

</div>

Hello,

I’m facing a problem and I’m not sure if it’s a bug or a feature 🙂

I have a role that includes other role (using meta dependency), when including that role more than once in my playbook, it runs only once:

role/mymetarole/meta/main.yml:

`

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [June 11, 2014, 6:48pm UTC](https://forum.ansible.com/t/ansible-and-complex-hierarchy/15442/2 "2014-06-11T18:48:19Z")

</div>

​Not sure, but I'd think you need to add this to  
​role/otherrole/meta/main.yml also?

---

<div class="post-metadata">

**Author:** ![andreub](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@andreub](https://forum.ansible.com/u/andreub)\
**Post date:** [June 11, 2014, 8:16pm UTC](https://forum.ansible.com/t/ansible-and-complex-hierarchy/15442/3 "2014-06-11T20:16:43Z")

</div>

Yes! it worked for the tasks, thanks

The only thing were the handlers, they were triggered just once. So I added (at the end of the meta-task)

`- meta: flush_handlers`

And then they were ran twice but both with the parameters of the first role

Finally I had to add parametrize the handlers as explained here: [https://github.com/ansible/ansible/issues/6312](https://github.com/ansible/ansible/issues/6312)

`

- name: stop service {{ service\_name }}  
service: name=“{{ service\_name }}” state=stopped

`
