mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Ensure we only cache the loop when the task had a loop (#44901)
* Further restrict caching of loop when the task actually had a loop. Fixes #44874 * Extend tests for loop caching
This commit is contained in:
parent
6059da245b
commit
9d89e15ff0
3 changed files with 19 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
|||
add_host:
|
||||
name: "foo{{item}}"
|
||||
groups: foo
|
||||
ansible_connection: local
|
||||
loop: "{{ range(10)|list }}"
|
||||
|
||||
# We expect all of the next 3 runs to succeeed
|
||||
|
@ -56,3 +57,16 @@
|
|||
- "{{ (result1.results|first) is successful }}"
|
||||
- "{{ (result2.results|first) is successful }}"
|
||||
- "{{ (result3.results|first) is successful }}"
|
||||
|
||||
- name: Set delegate
|
||||
set_fact:
|
||||
_delegate: '{{ groups.foo[0] }}'
|
||||
|
||||
- command: "true"
|
||||
delegate_to: "{{ _delegate }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result.stdout is defined
|
||||
- result.results is undefined
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue