|
18 | 18 | command: "id -g -n" |
19 | 19 | register: my_group |
20 | 20 |
|
21 | | -- name: Check if the file {{ kdevops_hosts }} exists already |
| 21 | +- name: Check if the inventory file exists already |
22 | 22 | stat: |
23 | | - path: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 23 | + path: "{{ ansible_cfg_inventory }}" |
24 | 24 | register: kdevops_hosts_dest |
25 | 25 |
|
26 | | -- name: Ensure proper permission on the file {{ kdevops_hosts }} |
| 26 | +- name: Ensure proper permission on the inventory file |
27 | 27 | become: yes |
28 | 28 | become_flags: 'su - -c' |
29 | 29 | become_method: sudo |
30 | 30 | file: |
31 | | - path: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 31 | + path: "{{ ansible_cfg_inventory }}" |
32 | 32 | owner: "{{ my_user.stdout }}" |
33 | 33 | group: "{{ my_group.stdout }}" |
34 | 34 | when: |
35 | 35 | - kdevops_hosts_dest.stat.exists |
36 | 36 |
|
37 | | -- name: Verify Ansible host template file exists {{ kdevops_hosts_template_full_path }} |
| 37 | +- name: Verify Ansible inventory template file exists |
38 | 38 | stat: |
39 | 39 | path: "{{ kdevops_hosts_template_full_path }}" |
40 | 40 | register: ansible_hosts_template |
|
56 | 56 | when: |
57 | 57 | - is_fstests |
58 | 58 |
|
59 | | -- name: Generate the Ansible hosts file |
| 59 | +- name: Generate the Ansible inventory file |
60 | 60 | tags: [ 'hosts' ] |
61 | 61 | template: |
62 | 62 | src: "{{ kdevops_hosts_template }}" |
63 | | - dest: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 63 | + dest: "{{ ansible_cfg_inventory }}" |
64 | 64 | force: yes |
65 | 65 | trim_blocks: True |
66 | 66 | lstrip_blocks: True |
67 | 67 | when: |
68 | 68 | - not kdevops_workflows_dedicated_workflow |
69 | 69 | - ansible_hosts_template.stat.exists |
70 | 70 |
|
71 | | -- name: Generate the Ansible hosts file for dedicated cxl work |
| 71 | +- name: Generate the Ansible inventory file for dedicated cxl work |
72 | 72 | tags: [ 'hosts' ] |
73 | 73 | template: |
74 | 74 | src: "{{ kdevops_hosts_template }}" |
75 | | - dest: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 75 | + dest: "{{ anisble_cfg_inventory }}" |
76 | 76 | force: yes |
77 | 77 | trim_blocks: True |
78 | 78 | lstrip_blocks: True |
|
81 | 81 | - kdevops_workflow_enable_cxl |
82 | 82 | - ansible_hosts_template.stat.exists |
83 | 83 |
|
84 | | -- name: Generate the Ansible hosts file for dedicated pynfs work |
| 84 | +- name: Generate the Ansible inventory file for dedicated pynfs work |
85 | 85 | tags: [ 'hosts' ] |
86 | 86 | template: |
87 | 87 | src: "{{ kdevops_hosts_template }}" |
88 | | - dest: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 88 | + dest: "{{ ansible_cfg_inventory }}" |
89 | 89 | force: yes |
90 | 90 | trim_blocks: True |
91 | 91 | lstrip_blocks: True |
|
94 | 94 | - kdevops_workflow_enable_pynfs |
95 | 95 | - ansible_hosts_template.stat.exists |
96 | 96 |
|
97 | | -- name: Generate the Ansible hosts file for dedicated gitr workflow |
| 97 | +- name: Generate the Ansible inventory file for dedicated gitr workflow |
98 | 98 | tags: [ 'hosts' ] |
99 | 99 | vars: |
100 | 100 | gitr_enabled_hosts: "{{ gitr_enabled_test_groups|ansible.builtin.split }}" |
101 | 101 | template: |
102 | 102 | src: "{{ kdevops_hosts_template }}" |
103 | | - dest: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 103 | + dest: "{{ ansible_cfg_inventory }}" |
104 | 104 | force: true |
105 | 105 | trim_blocks: true |
106 | 106 | lstrip_blocks: true |
|
109 | 109 | - kdevops_workflow_enable_gitr |
110 | 110 | - ansible_hosts_template.stat.exists |
111 | 111 |
|
112 | | -- name: Generate an Ansible hosts file for a dedicated ltp workflow |
| 112 | +- name: Generate an Ansible inventory file for a dedicated ltp workflow |
113 | 113 | tags: [ 'hosts' ] |
114 | 114 | vars: |
115 | 115 | ltp_enabled_hosts: "{{ ltp_enabled_test_groups|ansible.builtin.split }}" |
116 | 116 | ansible.builtin.template: |
117 | 117 | src: "{{ kdevops_hosts_template }}" |
118 | | - dest: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 118 | + dest: "{{ ansible_cfg_inventory }}" |
119 | 119 | force: yes |
120 | 120 | trim_blocks: True |
121 | 121 | lstrip_blocks: True |
|
124 | 124 | - kdevops_workflow_enable_ltp |
125 | 125 | - ansible_hosts_template.stat.exists |
126 | 126 |
|
127 | | -- name: Generate the Ansible hosts file for dedicated nfstest workflow |
| 127 | +- name: Generate the Ansible inventory file for dedicated nfstest workflow |
128 | 128 | tags: [ 'hosts' ] |
129 | 129 | vars: |
130 | 130 | nfstest_enabled_hosts: "{{ nfstest_enabled_test_groups | ansible.builtin.split }}" |
131 | 131 | template: |
132 | 132 | src: "{{ kdevops_hosts_template }}" |
133 | | - dest: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 133 | + dest: "{{ ansible_cfg_inventory }}" |
134 | 134 | force: true |
135 | 135 | trim_blocks: true |
136 | 136 | lstrip_blocks: true |
|
183 | 183 | - ansible_hosts_template.stat.exists |
184 | 184 | - item.changed |
185 | 185 |
|
186 | | -- name: Generate the Ansible hosts file for a dedicated fstests setup |
| 186 | +- name: Generate the Ansible inventory file for a dedicated fstests setup |
187 | 187 | tags: [ 'hosts' ] |
188 | 188 | vars: |
189 | 189 | fs_config_data: "{{ lookup('file', fs_config_path) }}" |
|
194 | 194 | sections: "{{ sections_replace_underscore | replace(\"'\", '') | split(', ') }}" |
195 | 195 | template: |
196 | 196 | src: "{{ kdevops_hosts_template }}" |
197 | | - dest: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 197 | + dest: "{{ ansible_cfg_inventory }}" |
198 | 198 | force: yes |
199 | 199 | trim_blocks: True |
200 | 200 | lstrip_blocks: True |
|
224 | 224 | - kdevops_workflow_enable_blktests |
225 | 225 | - ansible_hosts_template.stat.exists |
226 | 226 |
|
227 | | -- name: Generate the Ansible hosts file for a dedicated blktests setup |
| 227 | +- name: Generate the Ansible inventory file for a dedicated blktests setup |
228 | 228 | tags: [ 'hosts' ] |
229 | 229 | template: |
230 | 230 | src: "{{ kdevops_hosts_template }}" |
231 | | - dest: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 231 | + dest: "{{ ansible_cfg_inventory }}" |
232 | 232 | force: yes |
233 | 233 | trim_blocks: True |
234 | 234 | lstrip_blocks: True |
|
250 | 250 | - kdevops_workflow_enable_selftests |
251 | 251 | - ansible_hosts_template.stat.exists |
252 | 252 |
|
253 | | -- name: Generate the Ansible hosts file for a dedicated selftests setup |
| 253 | +- name: Generate the Ansible inventory file for a dedicated selftests setup |
254 | 254 | tags: [ 'hosts' ] |
255 | 255 | template: |
256 | 256 | src: "{{ kdevops_hosts_template }}" |
257 | | - dest: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 257 | + dest: "{{ ansible_cfg_inventory }}" |
258 | 258 | force: yes |
259 | 259 | trim_blocks: True |
260 | 260 | lstrip_blocks: True |
|
291 | 291 | - kdevops_workflows_dedicated_workflow |
292 | 292 | - kdevops_workflow_enable_sysbench |
293 | 293 |
|
294 | | -- name: Generate the Ansible hosts file for a dedicated sysbench setup |
| 294 | +- name: Generate the Ansible inventory file for a dedicated sysbench setup |
295 | 295 | tags: [ 'hosts' ] |
296 | 296 | template: |
297 | 297 | src: "{{ kdevops_hosts_template }}" |
298 | | - dest: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 298 | + dest: "{{ ansible_cfg_inventory }}" |
299 | 299 | force: yes |
300 | 300 | trim_blocks: True |
301 | 301 | lstrip_blocks: True |
|
306 | 306 |
|
307 | 307 | - name: Verify if final host file exists |
308 | 308 | stat: |
309 | | - path: "{{ topdir_path }}/{{ kdevops_hosts }}" |
| 309 | + path: "{{ ansible_cfg_inventory }}" |
310 | 310 | register: final_hosts_file |
311 | 311 |
|
312 | 312 | - name: Fail if the dedicated workflow has no rules for node configuration for hosts file configuration |
|
0 commit comments