mirror of https://github.com/ansible/ansible.git
fix handling allow_duplicates with the role cache (#82691)
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 Co-authored-by: Martin Krizek <martin.krizek@gmail.com>pull/78075/head
parent
8704b9fc29
commit
b3d8cdde5d
@ -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