|
5 | 5 | - name: Check vmX in inventory |
6 | 6 | ansible.builtin.assert: |
7 | 7 | 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" |
16 | 16 |
|
17 | 17 | - name: Check hosts in inventory |
18 | 18 | ansible.builtin.assert: |
19 | 19 | 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' |
27 | 27 |
|
28 | 28 | - name: Check port in inventory |
29 | 29 | ansible.builtin.assert: |
30 | 30 | 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 |
38 | 38 |
|
39 | 39 | - name: Check user in inventory |
40 | 40 | ansible.builtin.assert: |
41 | 41 | 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' |
49 | 49 |
|
50 | 50 | - name: Check groups in inventory |
51 | 51 | ansible.builtin.assert: |
52 | 52 | 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']" |
61 | 61 |
|
62 | 62 | - name: Check groups in inventory |
63 | 63 | ansible.builtin.assert: |
64 | 64 | 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' |
0 commit comments