mirror of
https://github.com/ansible/ansible.git
synced 2026-08-02 00:22:14 +02:00
* Ensure `allow_duplicates: true` enables to run single role multiple times(#64902) * Changed return value in `_load_roles` . Fixes #64902 * Add changelog fragment * Add an integration test for the issue * Fix changelog generation error and integration test. * Fix yaml syntax error in changelog fragment
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
---
|
||||
bugfixes:
|
||||
- "roles - Ensure that ``allow_duplidates: true`` enables to run single
|
||||
role multiple times (https://github.com/ansible/ansible/issues/64902)"
|
||||
@@ -201,11 +201,9 @@ class Play(Base, Taggable, CollectionSearch):
|
||||
for ri in role_includes:
|
||||
roles.append(Role.load(ri, play=self))
|
||||
|
||||
return self._extend_value(
|
||||
self.roles,
|
||||
roles,
|
||||
prepend=True
|
||||
)
|
||||
self.roles[:0] = roles
|
||||
|
||||
return self.roles
|
||||
|
||||
def _load_vars_prompt(self, attr, ds):
|
||||
new_ds = preprocess_vars(ds)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
---
|
||||
allow_duplicates: true
|
||||
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- debug:
|
||||
msg: "Tasks file inside role"
|
||||
@@ -104,3 +104,7 @@ ansible-playbook test_loop_var_bleed.yaml "$@"
|
||||
|
||||
# https://github.com/ansible/ansible/issues/56580
|
||||
ansible-playbook valid_include_keywords/playbook.yml "$@"
|
||||
|
||||
# https://github.com/ansible/ansible/issues/64902
|
||||
ansible-playbook tasks/test_allow_single_role_dup.yml 2>&1 | tee test_allow_single_role_dup.out
|
||||
test "$(grep -c 'ok=3' test_allow_single_role_dup.out)" = 1
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: test for allow_duplicates with single role
|
||||
hosts: localhost
|
||||
gather_facts: false
|
||||
roles:
|
||||
- dup_allowed_role
|
||||
- dup_allowed_role
|
||||
- dup_allowed_role
|
||||
Reference in New Issue
Block a user