Debian Codegraph @

test/integration/targets/templating_lookup_args/test.yml

raw
1 - hosts: testhost
2 gather_facts: no
3 tasks:
4 - name: ensure a lookup expression with an embedded template resolving to a marker-containing list exposes the marker to the lookup
5 assert:
6 that: lookup('accept_no_markers', [a_dict.a_key, 42])[1] == 42
7 vars:
8 a_dict:
9 a_key: "{{ not_defined }}"
10
11 - name: ensure the above expression also works with an embedded template (deprecated)
12 assert:
13 that: lookup('accept_no_markers', '{{ [a_dict.a_key, 42] }}')[1] == 42
14 vars:
15 a_dict:
16 a_key: "{{ not_defined }}"
17
18 - name: ensure that lookups accepting no args markers return undefined when passed one
19 debug:
20 msg: "{{ lookup('accept_no_markers', not_defined) is undefined }}"
21 register: result
22
23 - assert:
24 that: result.msg is true
25
26 - name: ensure the above expression also works with an embedded template (deprecated)
27 debug:
28 msg: "{{ lookup('accept_no_markers', '{{ not_defined }}') is undefined }}"
29 register: result
30
31 - assert:
32 that: result.msg is true
33
34 - name: ensure that lookups accepting args markers see them
35 assert:
36 that: lookup('accept_args_markers', not_defined) is true
37
38 - name: ensure the above expression also works with an embedded template (deprecated)
39 assert:
40 that: lookup('accept_args_markers', '{{ not_defined }}') is true