mirror of https://github.com/ansible/ansible.git
allow_duplicates is not part of the role uniqueness, so the value on the cached role may not match the current role.
* remove the allow_duplicates check from Role.has_run() which operates on the deduplicated role
* check the current role's allow_duplicates value in the strategy
(cherry picked from commit b3d8cdde5d)
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
pull/83027/head
parent
ba588f1b79
commit
12239abf72
@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- allow_duplicates - fix evaluating if the current role allows duplicates instead of using the initial value from the duplicate's cached role.
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- name: test for allow_duplicates with include_role
|
||||||
|
hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
tags:
|
||||||
|
- include
|
||||||
|
tasks:
|
||||||
|
- include_role:
|
||||||
|
name: dup_allowed_role
|
||||||
|
allow_duplicates: false
|
||||||
|
- include_role:
|
||||||
|
name: dup_allowed_role
|
||||||
|
- include_role:
|
||||||
|
name: dup_allowed_role
|
||||||
|
allow_duplicates: false
|
||||||
|
|
||||||
|
- name: test for allow_duplicates with import_role
|
||||||
|
hosts: localhost
|
||||||
|
gather_facts: false
|
||||||
|
tags:
|
||||||
|
- import
|
||||||
|
tasks:
|
||||||
|
- import_role:
|
||||||
|
name: dup_allowed_role
|
||||||
|
allow_duplicates: false
|
||||||
|
- import_role:
|
||||||
|
name: dup_allowed_role
|
||||||
|
- import_role:
|
||||||
|
name: dup_allowed_role
|
||||||
|
allow_duplicates: false
|
||||||
Loading…
Reference in New Issue