# duplicate role execution with role denpendencies

**URL:** <https://forum.ansible.com/t/duplicate-role-execution-with-role-denpendencies/16816>\
**Category:** Ansible Project\
**Created:** [November 18, 2014, 9:22pm UTC](https://forum.ansible.com/t/duplicate-role-execution-with-role-denpendencies/16816 "2014-11-18T21:22:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Wendler](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@Daniel\_Wendler](https://forum.ansible.com/u/Daniel_Wendler)\
**Post date:** [November 18, 2014, 9:22pm UTC](https://forum.ansible.com/t/duplicate-role-execution-with-role-denpendencies/16816/1 "2014-11-18T21:22:09Z")

</div>

Hello,

today i try to split our grown ansible roles in more simple roles.  
After do some work i realize that after rewrite and set some dependencies in our roles, some roles got executed multiple times.  
So i google a bit and found an bug report ([https://github.com/ansible/ansible/issues/5971](https://github.com/ansible/ansible/issues/5971)) which descibe the same behavior.  
The bug gets closed because of not reproducable and no further information.

So i recreate the simple test in comment nr. 4 and BAM…no duplicate running! After some testing i figured out the only difference to out plays.  
The duplicate run is triggered if you add some tags to the play.

no duplicate run:

`

- name: role dep test sample  
hosts: is  
roles:
- { role: base }
- { role: feature }

PLAY [role dep test sample] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK: [base | in base] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [fw48b] =\> {  
“msg”: “here we are in base”  
}

TASK: [feature | in feature] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [fw48b] =\> {  
“msg”: “here we are in feature”  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

`

duplicate run:

`

- name: role dep test sample  
hosts: is  
roles:
- { role: base, tags: base }
- { role: feature, tags: feature }

PLAY [role dep test sample] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK: [base | in base] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [fw48b] =\> {  
“msg”: “here we are in base”  
}

TASK: [base | in base] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [fw48b] =\> {  
“msg”: “here we are in base”  
}

TASK: [feature | in feature] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ok: [fw48b] =\> {  
“msg”: “here we are in feature”  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

`

As we use tags to limit the runs with the “-t” switch, i can not discard this tags in our playbooks. So what can we do to workaround this behavior?  
I don’t know how to reopen the bug.

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [November 19, 2014, 12:47am UTC](https://forum.ansible.com/t/duplicate-role-execution-with-role-denpendencies/16816/2 "2014-11-19T00:47:28Z")

</div>

Probably best to open a new bug and link to the old bug (as you did here).

-Toshio
