Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
6 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
test/integration/targets/include_import/tasks/test_dynamic_allow_dup.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |