# allow\_duplicates: yes doesn't work as expected

**URL:** <https://forum.ansible.com/t/allow-duplicates-yes-doesnt-work-as-expected/18821>\
**Category:** Ansible Project\
**Created:** [July 22, 2015, 2:17pm UTC](https://forum.ansible.com/t/allow-duplicates-yes-doesnt-work-as-expected/18821 "2015-07-22T14:17:56Z")\
**Posts on this page:** 3\
**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:** [July 22, 2015, 2:17pm UTC](https://forum.ansible.com/t/allow-duplicates-yes-doesnt-work-as-expected/18821/1 "2015-07-22T14:17:56Z")

</div>

Hello @all

today i took another try on the role dependency feature and realize that this doesn’t work as i expect this.  
First at all:

`ansible --version ansible 1.9.2 configured module search path = /usr/share/ansible`

I try to explain what i mean with an sample playbook/roles:

`  
$ cat play-test.yml

---

<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:** [July 22, 2015, 2:51pm UTC](https://forum.ansible.com/t/allow-duplicates-yes-doesnt-work-as-expected/18821/2 "2015-07-22T14:51:50Z")

</div>

I extend the example with another pice named tags:

`

$ cat play-test.yml

---

<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:** [July 24, 2015, 6:55am UTC](https://forum.ansible.com/t/allow-duplicates-yes-doesnt-work-as-expected/18821/3 "2015-07-24T06:55:52Z")

</div>

I have opened an [Issue](https://github.com/ansible/ansible/issues/11707) on github and **jimi-c** explained it logical:

Hi [@MorphBonehunter](https://github.com/MorphBonehunter), the problem is because `allow_duplicates` needs to be set on the base role, not in each of the intermediate roles. Move it there and this should work for you.

I’ve move the “allow\_duplicates: yes” to the base role and delete the entry in all other roles and it works like expected…so that was clearly my fault.

`

$ ansible-playbook play-test.yml --list-tasks

playbook: play-test.yml

play #1 (dependency test): TAGS:   
in base TAGS: [feature1]  
in feature1 TAGS: [feature1]  
in feature2 TAGS: [feature2]

`

But something is still strange when i remove the “allow\_duplicates: yes” also in the base role i got the following:

`

$ ansible-playbook play-test.yml --list-tasks -t feature1

playbook: play-test.yml

play #1 (dependency test): TAGS:   
in base TAGS: [feature1]  
in feature1 TAGS: [feature1]

$ ansible-playbook play-test.yml --list-tasks -t feature2

playbook: play-test.yml

play #1 (dependency test): TAGS:   
in feature2 TAGS: [feature2]

`

So in the second case the base role isn’t executed and this i think is not as expected.
