mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
Merge pull request #3654 from MaxIV-KitsControls/devel
Fix nested loop for more than 3 elements
This commit is contained in:
@@ -34,7 +34,7 @@ def combine(a,b):
|
|||||||
results = []
|
results = []
|
||||||
for x in a:
|
for x in a:
|
||||||
for y in b:
|
for y in b:
|
||||||
results.append([x,y])
|
results.append(flatten([x,y]))
|
||||||
return results
|
return results
|
||||||
|
|
||||||
class LookupModule(object):
|
class LookupModule(object):
|
||||||
|
|||||||
@@ -55,6 +55,15 @@
|
|||||||
action: copy src=sample.j2 dest=/tmp/ansible-test-with_lines-data
|
action: copy src=sample.j2 dest=/tmp/ansible-test-with_lines-data
|
||||||
- name: cleanup test file
|
- name: cleanup test file
|
||||||
action: file path=/tmp/ansible-test-with_lines-data state=absent
|
action: file path=/tmp/ansible-test-with_lines-data state=absent
|
||||||
|
|
||||||
|
# Test nested loop
|
||||||
|
- name: test nested loop with more than 3 elements
|
||||||
|
command: test "{{ item[0] }}, {{ item[1] }}, {{ item[2] }}, {{ item[3] }}" = "red, 1, up, top"
|
||||||
|
with_nested:
|
||||||
|
- [ 'red' ]
|
||||||
|
- [ 1 ]
|
||||||
|
- [ 'up']
|
||||||
|
- [ 'top']
|
||||||
|
|
||||||
# password lookup plugin
|
# password lookup plugin
|
||||||
- name: ensure test file doesn't exist
|
- name: ensure test file doesn't exist
|
||||||
|
|||||||
Reference in New Issue
Block a user