# Role deduplication fails with \`-‌-skip-tags always\`

**URL:** <https://forum.ansible.com/t/role-deduplication-fails-with-skip-tags-always/46550>\
**Category:** Get Help\
**Created:** [October 27, 2026, 7:45pm UTC](https://forum.ansible.com/t/role-deduplication-fails-with-skip-tags-always/46550 "2026-10-27T19:45:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirabilos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mirabilos/32/9721_2.png) [@mirabilos](https://forum.ansible.com/u/mirabilos)\
**Post date:** [October 27, 2026, 7:45pm UTC](https://forum.ansible.com/t/role-deduplication-fails-with-skip-tags-always/46550/1 "2026-10-27T19:45:42Z")

</div>

For Ansible 2.19, reduced to the following:

Playbook:

```auto
[…]
  roles:
  - role: mariadb
  - role: xyz # actual product name changed
[…]

```

Roles:

```auto
$ cat roles/mariadb/meta/main.yml 
---
dependencies:
- role: mysql_mariadb_common
$ cat roles/xyz/meta/main.yml     
---
dependencies:
- role: mysql_mariadb_common

$ cat roles/mysql_mariadb_common/tasks/main.yml
---
- name: "DEBUG | discover roles : hosts mapping | role mysql_mariadb_common"
  ansible.builtin.debug:
    msg: "host {{ inventory_hostname_short }} has role mysql_mariadb_common"
  tags: ["has-roles", "has-role-mysql_mariadb_common"]
  delegate_to: localhost

```

When called as `env ANSIBLE_GATHERING=explicit ansible-playbook -t has-roles --skip-tags always $playbookname`, the `mysql_mariadb_common` role is ran twice (once before each of the depending roles).

---

<div class="post-metadata">

**Author:** ![bvitnik](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bvitnik/32/4132_2.png) [@bvitnik](https://forum.ansible.com/u/bvitnik)\
**Post date:** [October 27, 2026, 10:54pm UTC](https://forum.ansible.com/t/role-deduplication-fails-with-skip-tags-always/46550/2 "2026-10-27T22:54:56Z")

</div>

Interesting 🤔

I can reproduce this on 2.20 too. Shared role is invoked twice but only if `--skip-tags always` is specified. That one is the culprit.

This is as if skipping the `always` tag makes Ansible skip some internal hidden deduplicator task.

I personally use this pattern in my code but never encountered this problem… and now that I think, I can’t remember if I ever used `--skip-tags always`.

---

<div class="post-metadata">

**Author:** ![mirabilos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mirabilos/32/9721_2.png) [@mirabilos](https://forum.ansible.com/u/mirabilos)\
**Post date:** [October 27, 2026, 11:02pm UTC](https://forum.ansible.com/t/role-deduplication-fails-with-skip-tags-always/46550/3 "2026-10-27T23:02:34Z")

</div>

Thanks for reproducing and tracking this down!

I have a few `always`-tagged tasks (the one with the asserts (see above), which needs facts gathering for some hosts, and one that checks the clocktime of the controlled systems against the controlling node, etc.), and I want to skip these when I do a local-only thing like figuring out which hosts have which roles (this info gets collected in a dump file that gets committed as documentation), as this can run without needing to contact the targets (not all targets are even up normally).

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [October 28, 2026, 3:38pm UTC](https://forum.ansible.com/t/role-deduplication-fails-with-skip-tags-always/46550/4 "2026-10-28T15:38:04Z")

</div>

Internally we flag a `role_complete` task with `always` so skipping that makes the ‘role not finished’ so it does not count for de duplication. Please open a bug report on github: [Issues · ansible/ansible · GitHub](https://github.com/ansible/ansible/issues)

---

<div class="post-metadata">

**Author:** ![mirabilos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mirabilos/32/9721_2.png) [@mirabilos](https://forum.ansible.com/u/mirabilos)\
**Post date:** [October 28, 2026, 5:26pm UTC](https://forum.ansible.com/t/role-deduplication-fails-with-skip-tags-always/46550/5 "2026-10-28T17:26:41Z")

</div>

filed [role deduplication not ran with `--skip-tags always` · Issue #87820 · ansible/ansible · GitHub](https://github.com/ansible/ansible/issues/87820)

thanks
