|
|
|
@ -103,54 +103,6 @@
|
|
|
|
|
- 'results6["results"][0]["ping"] == "Hello World"'
|
|
|
|
|
- 'results6["results"][1]["ping"] == "Olá Mundo"'
|
|
|
|
|
|
|
|
|
|
- name: Test that loop works with a list via the query lookup
|
|
|
|
|
ping:
|
|
|
|
|
data: '{{ item }}'
|
|
|
|
|
loop: '{{ query("list", "Hello World", "Olá Mundo") }}'
|
|
|
|
|
register: results7
|
|
|
|
|
|
|
|
|
|
- name: Assert that we ran the module twice with the correct strings
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- 'results7["results"][0]["ping"] == "Hello World"'
|
|
|
|
|
- 'results7["results"][1]["ping"] == "Olá Mundo"'
|
|
|
|
|
|
|
|
|
|
- name: Test that loop works with a list in a variable via the query lookup
|
|
|
|
|
ping:
|
|
|
|
|
data: '{{ item }}'
|
|
|
|
|
loop: '{{ q("list", *phrases) }}'
|
|
|
|
|
register: results8
|
|
|
|
|
|
|
|
|
|
- name: Assert that we ran the module twice with the correct strings
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- 'results8["results"][0]["ping"] == "Hello World"'
|
|
|
|
|
- 'results8["results"][1]["ping"] == "Olá Mundo"'
|
|
|
|
|
|
|
|
|
|
- name: Test that loop works with a list and keyword args
|
|
|
|
|
ping:
|
|
|
|
|
data: '{{ item }}'
|
|
|
|
|
loop: '{{ q("file", "data1.txt", "data2.txt", lstrip=True) }}'
|
|
|
|
|
register: results9
|
|
|
|
|
|
|
|
|
|
- name: Assert that we ran the module twice with the correct strings
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- 'results9["results"][0]["ping"] == "Hello World"'
|
|
|
|
|
- 'results9["results"][1]["ping"] == "Olá Mundo"'
|
|
|
|
|
|
|
|
|
|
- name: Test that loop works with a list in variable and keyword args
|
|
|
|
|
ping:
|
|
|
|
|
data: '{{ item }}'
|
|
|
|
|
loop: '{{ q("file", lstrip=True, *filenames) }}'
|
|
|
|
|
register: results10
|
|
|
|
|
|
|
|
|
|
- name: Assert that we ran the module twice with the correct strings
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- 'results10["results"][0]["ping"] == "Hello World"'
|
|
|
|
|
- 'results10["results"][1]["ping"] == "Olá Mundo"'
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# loop_control/index_var
|
|
|
|
|
#
|
|
|
|
|