Skip to content

Commit 4c6828a

Browse files
committed
ci: Remove jinja2 from assert, to avoid warnings
Warnings were like Warning: : conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ 'localhost' in hostvars }} Signed-off-by: Justin Cinkelj <[email protected]>
1 parent 816f16b commit 4c6828a

File tree

4 files changed

+127
-127
lines changed

4 files changed

+127
-127
lines changed

tests/integration/targets/inventory/tests/test_ansible_both_false.yml

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,62 @@
55
- name: Check vmX in inventory
66
ansible.builtin.assert:
77
that:
8-
- "{{ 'localhost' in hostvars }}"
9-
- "{{ 'ci-inventory-vm0' in hostvars }}"
10-
- "{{ 'ci-inventory-vm1' in hostvars }}"
11-
- "{{ 'ci-inventory-vm2' in hostvars }}"
12-
- "{{ 'ci-inventory-vm3' in hostvars }}"
13-
- "{{ 'ci-inventory-vm4' in hostvars }}"
14-
- "{{ 'ci-inventory-vm5' in hostvars }}"
15-
- "{{ 'ci-inventory-vm6' in hostvars }}"
8+
- "'localhost' in hostvars"
9+
- "'ci-inventory-vm0' in hostvars"
10+
- "'ci-inventory-vm1' in hostvars"
11+
- "'ci-inventory-vm2' in hostvars"
12+
- "'ci-inventory-vm3' in hostvars"
13+
- "'ci-inventory-vm4' in hostvars"
14+
- "'ci-inventory-vm5' in hostvars"
15+
- "'ci-inventory-vm6' in hostvars"
1616

1717
- name: Check hosts in inventory
1818
ansible.builtin.assert:
1919
that:
20-
- "{{ hostvars['ci-inventory-vm0']['ansible_host'] == 'ci-inventory-vm0' }}"
21-
- "{{ hostvars['ci-inventory-vm1']['ansible_host'] == '10.0.0.1' }}"
22-
- "{{ hostvars['ci-inventory-vm2']['ansible_host'] == '10.0.0.2' }}"
23-
- "{{ hostvars['ci-inventory-vm3']['ansible_host'] == '10.0.0.3' }}"
24-
- "{{ hostvars['ci-inventory-vm4']['ansible_host'] == '10.0.0.4' }}"
25-
- "{{ hostvars['ci-inventory-vm5']['ansible_host'] == 'ci-inventory-vm5' }}"
26-
- "{{ hostvars['ci-inventory-vm6']['ansible_host'] == 'ci-inventory-vm6' }}"
20+
- hostvars['ci-inventory-vm0']['ansible_host'] == 'ci-inventory-vm0'
21+
- hostvars['ci-inventory-vm1']['ansible_host'] == '10.0.0.1'
22+
- hostvars['ci-inventory-vm2']['ansible_host'] == '10.0.0.2'
23+
- hostvars['ci-inventory-vm3']['ansible_host'] == '10.0.0.3'
24+
- hostvars['ci-inventory-vm4']['ansible_host'] == '10.0.0.4'
25+
- hostvars['ci-inventory-vm5']['ansible_host'] == 'ci-inventory-vm5'
26+
- hostvars['ci-inventory-vm6']['ansible_host'] == 'ci-inventory-vm6'
2727

2828
- name: Check port in inventory
2929
ansible.builtin.assert:
3030
that:
31-
- "{{ hostvars['ci-inventory-vm0']['ansible_port'] == 22 }}"
32-
- "{{ hostvars['ci-inventory-vm1']['ansible_port'] == 33 }}"
33-
- "{{ hostvars['ci-inventory-vm2']['ansible_port'] == 22 }}"
34-
- "{{ hostvars['ci-inventory-vm3']['ansible_port'] == 22 }}"
35-
- "{{ hostvars['ci-inventory-vm4']['ansible_port'] == 22 }}"
36-
- "{{ hostvars['ci-inventory-vm5']['ansible_port'] == 22 }}"
37-
- "{{ hostvars['ci-inventory-vm6']['ansible_port'] == 22 }}"
31+
- hostvars['ci-inventory-vm0']['ansible_port'] == 22
32+
- hostvars['ci-inventory-vm1']['ansible_port'] == 33
33+
- hostvars['ci-inventory-vm2']['ansible_port'] == 22
34+
- hostvars['ci-inventory-vm3']['ansible_port'] == 22
35+
- hostvars['ci-inventory-vm4']['ansible_port'] == 22
36+
- hostvars['ci-inventory-vm5']['ansible_port'] == 22
37+
- hostvars['ci-inventory-vm6']['ansible_port'] == 22
3838

3939
- name: Check user in inventory
4040
ansible.builtin.assert:
4141
that:
42-
- "{{ hostvars['ci-inventory-vm0']['ansible_user'] == 'root' }}"
43-
- "{{ hostvars['ci-inventory-vm1']['ansible_user'] == 'first' }}"
44-
- "{{ hostvars['ci-inventory-vm2']['ansible_user'] == 'root' }}"
45-
- "{{ hostvars['ci-inventory-vm3']['ansible_user'] == 'root' }}"
46-
- "{{ hostvars['ci-inventory-vm4']['ansible_user'] == 'root' }}"
47-
- "{{ hostvars['ci-inventory-vm5']['ansible_user'] == 'root' }}"
48-
- "{{ hostvars['ci-inventory-vm6']['ansible_user'] == 'second' }}"
42+
- hostvars['ci-inventory-vm0']['ansible_user'] == 'root'
43+
- hostvars['ci-inventory-vm1']['ansible_user'] == 'first'
44+
- hostvars['ci-inventory-vm2']['ansible_user'] == 'root'
45+
- hostvars['ci-inventory-vm3']['ansible_user'] == 'root'
46+
- hostvars['ci-inventory-vm4']['ansible_user'] == 'root'
47+
- hostvars['ci-inventory-vm5']['ansible_user'] == 'root'
48+
- hostvars['ci-inventory-vm6']['ansible_user'] == 'second'
4949

5050
- name: Check groups in inventory
5151
ansible.builtin.assert:
5252
that:
53-
- "{{ 'ci-inventory-vm0' in hostvars['ci-inventory-vm0']['groups']['ungrouped'] }}"
54-
- "{{ 'ci-inventory-vm1' in hostvars['ci-inventory-vm1']['groups']['ungrouped'] }}"
55-
- "{{ 'ci-inventory-vm2' in hostvars['ci-inventory-vm2']['groups']['ungrouped'] }}"
56-
- "{{ 'ci-inventory-vm3' in hostvars['ci-inventory-vm3']['groups']['ungrouped'] }}"
57-
- "{{ 'ci-inventory-vm4' in hostvars['ci-inventory-vm4']['groups']['grp0'] }}"
58-
- "{{ 'ci-inventory-vm5' in hostvars['ci-inventory-vm5']['groups']['grp1'] }}"
59-
- "{{ 'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp0'] }}"
60-
- "{{ 'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp1'] }}"
53+
- "'ci-inventory-vm0' in hostvars['ci-inventory-vm0']['groups']['ungrouped']"
54+
- "'ci-inventory-vm1' in hostvars['ci-inventory-vm1']['groups']['ungrouped']"
55+
- "'ci-inventory-vm2' in hostvars['ci-inventory-vm2']['groups']['ungrouped']"
56+
- "'ci-inventory-vm3' in hostvars['ci-inventory-vm3']['groups']['ungrouped']"
57+
- "'ci-inventory-vm4' in hostvars['ci-inventory-vm4']['groups']['grp0']"
58+
- "'ci-inventory-vm5' in hostvars['ci-inventory-vm5']['groups']['grp1']"
59+
- "'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp0']"
60+
- "'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp1']"
6161

6262
- name: Check groups in inventory
6363
ansible.builtin.assert:
6464
that:
65-
- "{{ hostvars['ci-inventory-vm3']['ansible_ssh_private_key_file'] == 'that_file.txt'}}"
66-
- "{{ hostvars['ci-inventory-vm5']['ansible_ssh_private_key_file'] == 'this_file.txt' }}"
65+
- hostvars['ci-inventory-vm3']['ansible_ssh_private_key_file'] == 'that_file.txt'
66+
- hostvars['ci-inventory-vm5']['ansible_ssh_private_key_file'] == 'this_file.txt'

tests/integration/targets/inventory/tests/test_ansible_both_true.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,50 @@
55
- name: Check vmX in inventory
66
ansible.builtin.assert:
77
that:
8-
- "{{ 'localhost' in hostvars }}"
9-
- "{{ 'ci-inventory-vm0' not in hostvars }}"
10-
- "{{ 'ci-inventory-vm1' not in hostvars }}"
11-
- "{{ 'ci-inventory-vm2' not in hostvars }}"
12-
- "{{ 'ci-inventory-vm3' in hostvars }}"
13-
- "{{ 'ci-inventory-vm4' in hostvars }}"
14-
- "{{ 'ci-inventory-vm5' in hostvars }}"
15-
- "{{ 'ci-inventory-vm6' in hostvars }}"
8+
- "'localhost' in hostvars"
9+
- "'ci-inventory-vm0' not in hostvars"
10+
- "'ci-inventory-vm1' not in hostvars"
11+
- "'ci-inventory-vm2' not in hostvars"
12+
- "'ci-inventory-vm3' in hostvars"
13+
- "'ci-inventory-vm4' in hostvars"
14+
- "'ci-inventory-vm5' in hostvars"
15+
- "'ci-inventory-vm6' in hostvars"
1616

1717
- name: Check hosts in inventory
1818
ansible.builtin.assert:
1919
that:
20-
- "{{ hostvars['ci-inventory-vm3']['ansible_host'] == '10.0.0.3' }}"
21-
- "{{ hostvars['ci-inventory-vm4']['ansible_host'] == '10.0.0.4' }}"
22-
- "{{ hostvars['ci-inventory-vm5']['ansible_host'] == 'ci-inventory-vm5' }}"
23-
- "{{ hostvars['ci-inventory-vm6']['ansible_host'] == 'ci-inventory-vm6' }}"
20+
- hostvars['ci-inventory-vm3']['ansible_host'] == '10.0.0.3'
21+
- hostvars['ci-inventory-vm4']['ansible_host'] == '10.0.0.4'
22+
- hostvars['ci-inventory-vm5']['ansible_host'] == 'ci-inventory-vm5'
23+
- hostvars['ci-inventory-vm6']['ansible_host'] == 'ci-inventory-vm6'
2424

2525
- name: Check port in inventory
2626
ansible.builtin.assert:
2727
that:
28-
- "{{ hostvars['ci-inventory-vm3']['ansible_port'] == 22 }}"
29-
- "{{ hostvars['ci-inventory-vm4']['ansible_port'] == 22 }}"
30-
- "{{ hostvars['ci-inventory-vm5']['ansible_port'] == 22 }}"
31-
- "{{ hostvars['ci-inventory-vm6']['ansible_port'] == 22 }}"
28+
- hostvars['ci-inventory-vm3']['ansible_port'] == 22
29+
- hostvars['ci-inventory-vm4']['ansible_port'] == 22
30+
- hostvars['ci-inventory-vm5']['ansible_port'] == 22
31+
- hostvars['ci-inventory-vm6']['ansible_port'] == 22
3232

3333
- name: Check user in inventory
3434
ansible.builtin.assert:
3535
that:
36-
- "{{ hostvars['ci-inventory-vm3']['ansible_user'] == 'root' }}"
37-
- "{{ hostvars['ci-inventory-vm4']['ansible_user'] == 'root' }}"
38-
- "{{ hostvars['ci-inventory-vm5']['ansible_user'] == 'root' }}"
39-
- "{{ hostvars['ci-inventory-vm6']['ansible_user'] == 'second' }}"
36+
- hostvars['ci-inventory-vm3']['ansible_user'] == 'root'
37+
- hostvars['ci-inventory-vm4']['ansible_user'] == 'root'
38+
- hostvars['ci-inventory-vm5']['ansible_user'] == 'root'
39+
- hostvars['ci-inventory-vm6']['ansible_user'] == 'second'
4040

4141
- name: Check groups in inventory
4242
ansible.builtin.assert:
4343
that:
44-
- "{{ 'ci-inventory-vm3' in hostvars['ci-inventory-vm3']['groups']['ungrouped'] }}"
45-
- "{{ 'ci-inventory-vm4' in hostvars['ci-inventory-vm4']['groups']['grp0'] }}"
46-
- "{{ 'ci-inventory-vm5' in hostvars['ci-inventory-vm5']['groups']['grp1'] }}"
47-
- "{{ 'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp0'] }}"
48-
- "{{ 'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp1'] }}"
44+
- "'ci-inventory-vm3' in hostvars['ci-inventory-vm3']['groups']['ungrouped']"
45+
- "'ci-inventory-vm4' in hostvars['ci-inventory-vm4']['groups']['grp0']"
46+
- "'ci-inventory-vm5' in hostvars['ci-inventory-vm5']['groups']['grp1']"
47+
- "'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp0']"
48+
- "'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp1']"
4949

5050
- name: Check groups in inventory
5151
ansible.builtin.assert:
5252
that:
53-
- "{{ hostvars['ci-inventory-vm3']['ansible_ssh_private_key_file'] == 'that_file.txt'}}"
54-
- "{{ hostvars['ci-inventory-vm5']['ansible_ssh_private_key_file'] == 'this_file.txt' }}"
53+
- hostvars['ci-inventory-vm3']['ansible_ssh_private_key_file'] == 'that_file.txt'
54+
- hostvars['ci-inventory-vm5']['ansible_ssh_private_key_file'] == 'this_file.txt'

tests/integration/targets/inventory/tests/test_ansible_disable.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,54 @@
55
- name: Check vmX in inventory
66
ansible.builtin.assert:
77
that:
8-
- "{{ 'localhost' in hostvars }}"
9-
- "{{ 'ci-inventory-vm0' in hostvars }}"
10-
- "{{ 'ci-inventory-vm1' not in hostvars }}"
11-
- "{{ 'ci-inventory-vm2' not in hostvars }}"
12-
- "{{ 'ci-inventory-vm3' in hostvars }}"
13-
- "{{ 'ci-inventory-vm4' in hostvars }}"
14-
- "{{ 'ci-inventory-vm5' in hostvars }}"
15-
- "{{ 'ci-inventory-vm6' in hostvars }}"
8+
- "'localhost' in hostvars"
9+
- "'ci-inventory-vm0' in hostvars"
10+
- "'ci-inventory-vm1' not in hostvars"
11+
- "'ci-inventory-vm2' not in hostvars"
12+
- "'ci-inventory-vm3' in hostvars"
13+
- "'ci-inventory-vm4' in hostvars"
14+
- "'ci-inventory-vm5' in hostvars"
15+
- "'ci-inventory-vm6' in hostvars"
1616

1717
- name: Check hosts in inventory
1818
ansible.builtin.assert:
1919
that:
20-
- "{{ hostvars['ci-inventory-vm0']['ansible_host'] == 'ci-inventory-vm0' }}"
21-
- "{{ hostvars['ci-inventory-vm3']['ansible_host'] == '10.0.0.3' }}"
22-
- "{{ hostvars['ci-inventory-vm4']['ansible_host'] == '10.0.0.4' }}"
23-
- "{{ hostvars['ci-inventory-vm5']['ansible_host'] == 'ci-inventory-vm5' }}"
24-
- "{{ hostvars['ci-inventory-vm6']['ansible_host'] == 'ci-inventory-vm6' }}"
20+
- hostvars['ci-inventory-vm0']['ansible_host'] == 'ci-inventory-vm0'
21+
- hostvars['ci-inventory-vm3']['ansible_host'] == '10.0.0.3'
22+
- hostvars['ci-inventory-vm4']['ansible_host'] == '10.0.0.4'
23+
- hostvars['ci-inventory-vm5']['ansible_host'] == 'ci-inventory-vm5'
24+
- hostvars['ci-inventory-vm6']['ansible_host'] == 'ci-inventory-vm6'
2525

2626
- name: Check port in inventory
2727
ansible.builtin.assert:
2828
that:
29-
- "{{ hostvars['ci-inventory-vm0']['ansible_port'] == 22 }}"
30-
- "{{ hostvars['ci-inventory-vm3']['ansible_port'] == 22 }}"
31-
- "{{ hostvars['ci-inventory-vm4']['ansible_port'] == 22 }}"
32-
- "{{ hostvars['ci-inventory-vm5']['ansible_port'] == 22 }}"
33-
- "{{ hostvars['ci-inventory-vm6']['ansible_port'] == 22 }}"
29+
- hostvars['ci-inventory-vm0']['ansible_port'] == 22
30+
- hostvars['ci-inventory-vm3']['ansible_port'] == 22
31+
- hostvars['ci-inventory-vm4']['ansible_port'] == 22
32+
- hostvars['ci-inventory-vm5']['ansible_port'] == 22
33+
- hostvars['ci-inventory-vm6']['ansible_port'] == 22
3434

3535
- name: Check user in inventory
3636
ansible.builtin.assert:
3737
that:
38-
- "{{ hostvars['ci-inventory-vm0']['ansible_user'] == 'root' }}"
39-
- "{{ hostvars['ci-inventory-vm3']['ansible_user'] == 'root' }}"
40-
- "{{ hostvars['ci-inventory-vm4']['ansible_user'] == 'root' }}"
41-
- "{{ hostvars['ci-inventory-vm5']['ansible_user'] == 'root' }}"
42-
- "{{ hostvars['ci-inventory-vm6']['ansible_user'] == 'second' }}"
38+
- hostvars['ci-inventory-vm0']['ansible_user'] == 'root'
39+
- hostvars['ci-inventory-vm3']['ansible_user'] == 'root'
40+
- hostvars['ci-inventory-vm4']['ansible_user'] == 'root'
41+
- hostvars['ci-inventory-vm5']['ansible_user'] == 'root'
42+
- hostvars['ci-inventory-vm6']['ansible_user'] == 'second'
4343

4444
- name: Check groups in inventory
4545
ansible.builtin.assert:
4646
that:
47-
- "{{ 'ci-inventory-vm0' in hostvars['ci-inventory-vm0']['groups']['ungrouped'] }}"
48-
- "{{ 'ci-inventory-vm3' in hostvars['ci-inventory-vm3']['groups']['ungrouped'] }}"
49-
- "{{ 'ci-inventory-vm4' in hostvars['ci-inventory-vm4']['groups']['grp0'] }}"
50-
- "{{ 'ci-inventory-vm5' in hostvars['ci-inventory-vm5']['groups']['grp1'] }}"
51-
- "{{ 'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp0'] }}"
52-
- "{{ 'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp1'] }}"
47+
- "'ci-inventory-vm0' in hostvars['ci-inventory-vm0']['groups']['ungrouped']"
48+
- "'ci-inventory-vm3' in hostvars['ci-inventory-vm3']['groups']['ungrouped']"
49+
- "'ci-inventory-vm4' in hostvars['ci-inventory-vm4']['groups']['grp0']"
50+
- "'ci-inventory-vm5' in hostvars['ci-inventory-vm5']['groups']['grp1']"
51+
- "'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp0']"
52+
- "'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp1']"
5353

5454
- name: Check groups in inventory
5555
ansible.builtin.assert:
5656
that:
57-
- "{{ hostvars['ci-inventory-vm3']['ansible_ssh_private_key_file'] == 'that_file.txt'}}"
58-
- "{{ hostvars['ci-inventory-vm5']['ansible_ssh_private_key_file'] == 'this_file.txt' }}"
57+
- hostvars['ci-inventory-vm3']['ansible_ssh_private_key_file'] == 'that_file.txt'
58+
- hostvars['ci-inventory-vm5']['ansible_ssh_private_key_file'] == 'this_file.txt'

tests/integration/targets/inventory/tests/test_ansible_enable.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,53 @@
55
- name: Check vmX in inventory
66
ansible.builtin.assert:
77
that:
8-
- "{{ 'ci-inventory-vm0' not in hostvars }}"
9-
- "{{ 'ci-inventory-vm1' not in hostvars }}"
10-
- "{{ 'ci-inventory-vm2' in hostvars }}"
11-
- "{{ 'ci-inventory-vm3' in hostvars }}"
12-
- "{{ 'ci-inventory-vm4' in hostvars }}"
13-
- "{{ 'ci-inventory-vm5' in hostvars }}"
14-
- "{{ 'ci-inventory-vm6' in hostvars }}"
8+
- "'ci-inventory-vm0' not in hostvars"
9+
- "'ci-inventory-vm1' not in hostvars"
10+
- "'ci-inventory-vm2' in hostvars"
11+
- "'ci-inventory-vm3' in hostvars"
12+
- "'ci-inventory-vm4' in hostvars"
13+
- "'ci-inventory-vm5' in hostvars"
14+
- "'ci-inventory-vm6' in hostvars"
1515

1616
- name: Check hosts in inventory
1717
ansible.builtin.assert:
1818
that:
19-
- "{{ hostvars['ci-inventory-vm2']['ansible_host'] == '10.0.0.2' }}"
20-
- "{{ hostvars['ci-inventory-vm3']['ansible_host'] == '10.0.0.3' }}"
21-
- "{{ hostvars['ci-inventory-vm4']['ansible_host'] == '10.0.0.4' }}"
22-
- "{{ hostvars['ci-inventory-vm5']['ansible_host'] == 'ci-inventory-vm5' }}"
23-
- "{{ hostvars['ci-inventory-vm6']['ansible_host'] == 'ci-inventory-vm6' }}"
19+
- hostvars['ci-inventory-vm2']['ansible_host'] == '10.0.0.2'
20+
- hostvars['ci-inventory-vm3']['ansible_host'] == '10.0.0.3'
21+
- hostvars['ci-inventory-vm4']['ansible_host'] == '10.0.0.4'
22+
- hostvars['ci-inventory-vm5']['ansible_host'] == 'ci-inventory-vm5'
23+
- hostvars['ci-inventory-vm6']['ansible_host'] == 'ci-inventory-vm6'
2424

2525
- name: Check port in inventory
2626
ansible.builtin.assert:
2727
that:
28-
- "{{ hostvars['ci-inventory-vm3']['ansible_port'] == 22 }}"
29-
- "{{ hostvars['ci-inventory-vm2']['ansible_port'] == 22 }}"
30-
- "{{ hostvars['ci-inventory-vm4']['ansible_port'] == 22 }}"
31-
- "{{ hostvars['ci-inventory-vm5']['ansible_port'] == 22 }}"
32-
- "{{ hostvars['ci-inventory-vm6']['ansible_port'] == 22 }}"
28+
- hostvars['ci-inventory-vm3']['ansible_port'] == 22
29+
- hostvars['ci-inventory-vm2']['ansible_port'] == 22
30+
- hostvars['ci-inventory-vm4']['ansible_port'] == 22
31+
- hostvars['ci-inventory-vm5']['ansible_port'] == 22
32+
- hostvars['ci-inventory-vm6']['ansible_port'] == 22
3333

3434
- name: Check user in inventory
3535
ansible.builtin.assert:
3636
that:
37-
- "{{ hostvars['ci-inventory-vm3']['ansible_user'] == 'root' }}"
38-
- "{{ hostvars['ci-inventory-vm2']['ansible_user'] == 'root' }}"
39-
- "{{ hostvars['ci-inventory-vm4']['ansible_user'] == 'root' }}"
40-
- "{{ hostvars['ci-inventory-vm5']['ansible_user'] == 'root' }}"
41-
- "{{ hostvars['ci-inventory-vm6']['ansible_user'] == 'second' }}"
37+
- hostvars['ci-inventory-vm3']['ansible_user'] == 'root'
38+
- hostvars['ci-inventory-vm2']['ansible_user'] == 'root'
39+
- hostvars['ci-inventory-vm4']['ansible_user'] == 'root'
40+
- hostvars['ci-inventory-vm5']['ansible_user'] == 'root'
41+
- hostvars['ci-inventory-vm6']['ansible_user'] == 'second'
4242

4343
- name: Check groups in inventory
4444
ansible.builtin.assert:
4545
that:
46-
- "{{ 'ci-inventory-vm2' in hostvars['ci-inventory-vm2']['groups']['ungrouped'] }}"
47-
- "{{ 'ci-inventory-vm3' in hostvars['ci-inventory-vm3']['groups']['ungrouped'] }}"
48-
- "{{ 'ci-inventory-vm4' in hostvars['ci-inventory-vm4']['groups']['grp0'] }}"
49-
- "{{ 'ci-inventory-vm5' in hostvars['ci-inventory-vm5']['groups']['grp1'] }}"
50-
- "{{ 'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp0'] }}"
51-
- "{{ 'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp1'] }}"
46+
- "'ci-inventory-vm2' in hostvars['ci-inventory-vm2']['groups']['ungrouped']"
47+
- "'ci-inventory-vm3' in hostvars['ci-inventory-vm3']['groups']['ungrouped']"
48+
- "'ci-inventory-vm4' in hostvars['ci-inventory-vm4']['groups']['grp0']"
49+
- "'ci-inventory-vm5' in hostvars['ci-inventory-vm5']['groups']['grp1']"
50+
- "'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp0']"
51+
- "'ci-inventory-vm6' in hostvars['ci-inventory-vm6']['groups']['grp1']"
5252

5353
- name: Check groups in inventory
5454
ansible.builtin.assert:
5555
that:
56-
- "{{ hostvars['ci-inventory-vm3']['ansible_ssh_private_key_file'] == 'that_file.txt'}}"
57-
- "{{ hostvars['ci-inventory-vm5']['ansible_ssh_private_key_file'] == 'this_file.txt' }}"
56+
- hostvars['ci-inventory-vm3']['ansible_ssh_private_key_file'] == 'that_file.txt'
57+
- hostvars['ci-inventory-vm5']['ansible_ssh_private_key_file'] == 'this_file.txt'

0 commit comments

Comments
 (0)