Debian Codegraph @

test/integration/targets/loop-validation/tasks/main.yml

raw
1 - name: Invalid loop_control.loop_var value
2 debug:
3 loop: [1]
4 loop_control:
5 loop_var: "0"
6 ignore_errors: yes
7 register: result
8
9 - assert:
10 that: |
11 result.msg == "Invalid 'loop_var': Invalid variable name '0'."
12
13 - name: Invalid loop_control.index_var value
14 debug:
15 loop: [1]
16 loop_control:
17 index_var: "0"
18 ignore_errors: yes
19 register: result
20
21 - assert:
22 that: |
23 result.msg == "Invalid 'index_var': Invalid variable name '0'."
24
25 - name: Invalid loop_control.pause value
26 debug:
27 loop: [1]
28 loop_control:
29 pause: not-a-number
30 ignore_errors: yes
31 register: result
32
33 - assert:
34 that: |
35 result.msg == "Error processing keyword 'pause': The value 'not-a-number' could not be converted to 'float'."
36
37 - name: Invalid loop_control.extended value
38 debug:
39 loop: [1]
40 loop_control:
41 extended: not-a-bool
42 ignore_errors: yes
43 register: result
44
45 - assert:
46 that: |
47 result.msg == "Error processing keyword 'extended': The value 'not-a-bool' could not be converted to 'bool'."
48
49 - name: Invalid loop_control.extended_allitems value
50 debug:
51 loop: [1]
52 loop_control:
53 extended_allitems: not-a-bool
54 ignore_errors: yes
55 register: result
56
57 - assert:
58 that: |
59 result.msg == "Error processing keyword 'extended_allitems': The value 'not-a-bool' could not be converted to 'bool'."
60
61 - name: Invalid loop_control.break_when value
62 debug:
63 loop: [1]
64 loop_control:
65 break_when:
66 nope: sorry
67 ignore_errors: yes
68 register: result
69
70 - assert:
71 that:
72 - result.msg == "One or more items failed"
73 - result is failed
74 - result.results[0].break_when_result == "Conditional expressions must be strings."
75 - result.results[0].msg == "Hello world!"
76 - result.results[0] is failed