|
1 | 1 | --- |
2 | 2 | - name: test fail missing params |
3 | | - cs_host: |
| 3 | + ngine_io.cloudstack.host: |
4 | 4 | zone: "{{ cs_common_zone_basic }}" |
5 | 5 | register: host |
6 | 6 | ignore_errors: true |
|
11 | 11 | - 'host.msg == "missing required arguments: name"' |
12 | 12 |
|
13 | 13 | - name: test fail missing params if host is not existent |
14 | | - cs_host: |
| 14 | + ngine_io.cloudstack.host: |
15 | 15 | name: sim |
16 | 16 | zone: "{{ cs_common_zone_basic }}" |
17 | 17 | register: host |
|
23 | 23 | - 'host.msg == "missing required arguments: password, username, hypervisor, pod"' |
24 | 24 |
|
25 | 25 | - name: test create a host in check mode |
26 | | - cs_host: |
| 26 | + ngine_io.cloudstack.host: |
27 | 27 | name: sim |
28 | 28 | zone: "{{ cs_common_zone_basic }}" |
29 | 29 | url: "http://sim/c0-basic/h2" |
|
34 | 34 | hypervisor: Simulator |
35 | 35 | allocation_state: enabled |
36 | 36 | host_tags: |
37 | | - - perf |
38 | | - - gpu |
| 37 | + - perf |
| 38 | + - gpu |
39 | 39 | register: host |
40 | 40 | check_mode: true |
41 | 41 | - name: verify test create a host in check mode |
|
44 | 44 | - host is changed |
45 | 45 |
|
46 | 46 | - name: test create a host |
47 | | - cs_host: |
| 47 | + ngine_io.cloudstack.host: |
48 | 48 | name: sim |
49 | 49 | zone: "{{ cs_common_zone_basic }}" |
50 | 50 | url: "http://sim/c0-basic/h2" |
|
55 | 55 | hypervisor: Simulator |
56 | 56 | allocation_state: enabled |
57 | 57 | host_tags: |
58 | | - - perf |
59 | | - - gpu |
| 58 | + - perf |
| 59 | + - gpu |
60 | 60 | register: host |
61 | 61 | - name: verify test create a host |
62 | 62 | assert: |
|
69 | 69 | - host.zone == 'Sandbox-simulator-basic' |
70 | 70 | - host.state == 'Up' |
71 | 71 | - "host.name.startswith('SimulatedAgent.')" |
72 | | - - host.host_tags == ['perf', 'gpu'] |
| 72 | + - host.host_tags|sort == ['gpu', 'perf'] |
73 | 73 |
|
74 | 74 | # This is special in simulator mode, we can not predict the full hostname. |
75 | 75 | # That is why we gather the infos from the returns and use a fact. |
|
79 | 79 | host_ip_address: "{{ host.ip_address }}" |
80 | 80 |
|
81 | 81 | - name: test create a host idempotence |
82 | | - cs_host: |
| 82 | + ngine_io.cloudstack.host: |
83 | 83 | name: "{{ host_hostname }}" |
84 | 84 | zone: "{{ cs_common_zone_basic }}" |
85 | 85 | url: "http://sim/c0-basic/h2" |
|
90 | 90 | hypervisor: Simulator |
91 | 91 | allocation_state: enabled |
92 | 92 | host_tags: |
93 | | - - perf |
94 | | - - gpu |
| 93 | + - perf |
| 94 | + - gpu |
95 | 95 | register: host |
96 | 96 | - name: verify test create a host idempotence |
97 | 97 | assert: |
|
103 | 103 | - host.allocation_state == 'enabled' |
104 | 104 | - host.zone == 'Sandbox-simulator-basic' |
105 | 105 | - host.state == 'Up' |
106 | | - - host.name == '{{ host_hostname }}' |
107 | | - - host.host_tags == ['perf', 'gpu'] |
| 106 | + - host.name == host_hostname |
| 107 | + - host.host_tags|sort == ['gpu', 'perf'] |
108 | 108 |
|
109 | 109 | - name: test update host in check mode |
110 | | - cs_host: |
| 110 | + ngine_io.cloudstack.host: |
111 | 111 | name: "{{ host_hostname }}" |
112 | 112 | zone: "{{ cs_common_zone_basic }}" |
113 | 113 | url: "http://sim/c0-basic/h2" |
|
118 | 118 | hypervisor: Simulator |
119 | 119 | allocation_state: enabled |
120 | 120 | host_tags: |
121 | | - - perf |
122 | | - - gpu |
123 | | - - x2 |
| 121 | + - perf |
| 122 | + - gpu |
| 123 | + - x2 |
124 | 124 | register: host |
125 | 125 | check_mode: true |
126 | 126 | - name: verify test update a host in check mode |
|
133 | 133 | - host.allocation_state == 'enabled' |
134 | 134 | - host.zone == 'Sandbox-simulator-basic' |
135 | 135 | - host.state == 'Up' |
136 | | - - host.name == '{{ host_hostname }}' |
137 | | - - host.host_tags == ['perf', 'gpu'] |
| 136 | + - host.name == host_hostname |
| 137 | + - host.host_tags|sort == ['gpu', 'perf'] |
138 | 138 |
|
139 | 139 | - name: test update host |
140 | | - cs_host: |
| 140 | + ngine_io.cloudstack.host: |
141 | 141 | name: "{{ host_hostname }}" |
142 | 142 | zone: "{{ cs_common_zone_basic }}" |
143 | 143 | url: "http://sim/c0-basic/h2" |
|
148 | 148 | hypervisor: Simulator |
149 | 149 | allocation_state: enabled |
150 | 150 | host_tags: |
151 | | - - perf |
152 | | - - gpu |
153 | | - - x2 |
| 151 | + - perf |
| 152 | + - gpu |
| 153 | + - x2 |
154 | 154 | register: host |
155 | 155 | - name: verify test update a host in check mode |
156 | 156 | assert: |
|
162 | 162 | - host.allocation_state == 'enabled' |
163 | 163 | - host.zone == 'Sandbox-simulator-basic' |
164 | 164 | - host.state == 'Up' |
165 | | - - host.name == '{{ host_hostname }}' |
166 | | - - host.host_tags == ['perf', 'gpu', 'x2'] |
| 165 | + - host.name == host_hostname |
| 166 | + - host.host_tags|sort == ['gpu', 'perf', 'x2'] |
167 | 167 |
|
168 | 168 | - name: test update host idempotence |
169 | | - cs_host: |
| 169 | + ngine_io.cloudstack.host: |
170 | 170 | name: "{{ host_hostname }}" |
171 | 171 | zone: "{{ cs_common_zone_basic }}" |
172 | 172 | url: "http://sim/c0-basic/h2" |
|
177 | 177 | hypervisor: Simulator |
178 | 178 | allocation_state: enabled |
179 | 179 | host_tags: |
180 | | - - perf |
181 | | - - gpu |
182 | | - - x2 |
| 180 | + - perf |
| 181 | + - gpu |
| 182 | + - x2 |
183 | 183 | register: host |
184 | 184 | - name: verify test update a host idempotence |
185 | 185 | assert: |
|
191 | 191 | - host.allocation_state == 'enabled' |
192 | 192 | - host.zone == 'Sandbox-simulator-basic' |
193 | 193 | - host.state == 'Up' |
194 | | - - host.name == '{{ host_hostname }}' |
195 | | - - host.host_tags == ['perf', 'gpu', 'x2'] |
| 194 | + - host.name == host_hostname |
| 195 | + - host.host_tags|sort == ['gpu', 'perf', 'x2'] |
196 | 196 |
|
197 | 197 | # FIXME: Removing by empty list seems to be an issue in the used lib cs underneath, disabled |
198 | 198 | - name: test update host remove host_tags |
199 | | - cs_host: |
| 199 | + ngine_io.cloudstack.host: |
200 | 200 | name: "{{ host_hostname }}" |
201 | 201 | zone: "{{ cs_common_zone_basic }}" |
202 | 202 | url: "http://sim/c0-basic/h2" |
|
220 | 220 | - host.allocation_state == 'enabled' |
221 | 221 | - host.zone == 'Sandbox-simulator-basic' |
222 | 222 | - host.state == 'Up' |
223 | | - - host.name == '{{ host_hostname }}' |
| 223 | + - host.name == host_hostname |
224 | 224 | when: false |
225 | 225 |
|
226 | 226 | # FIXME: Removing by empty list seems to be an issue in the used lib cs underneath, disabled |
227 | 227 | - name: test update host remove host_tags idempotence |
228 | | - cs_host: |
| 228 | + ngine_io.cloudstack.host: |
229 | 229 | name: "{{ host_hostname }}" |
230 | 230 | zone: "{{ cs_common_zone_basic }}" |
231 | 231 | url: "http://sim/c0-basic/h2" |
|
249 | 249 | - host.allocation_state == 'enabled' |
250 | 250 | - host.zone == 'Sandbox-simulator-basic' |
251 | 251 | - host.state == 'Up' |
252 | | - - host.name == '{{ host_hostname }}' |
| 252 | + - host.name == host_hostname |
253 | 253 | when: false |
254 | 254 |
|
255 | | - |
256 | 255 | - name: test put host in maintenance in check mode |
257 | | - cs_host: |
| 256 | + ngine_io.cloudstack.host: |
258 | 257 | name: "{{ host_hostname }}" |
259 | 258 | zone: "{{ cs_common_zone_basic }}" |
260 | 259 | cluster: C0-basic |
|
272 | 271 | - host.allocation_state == 'enabled' |
273 | 272 | - host.zone == 'Sandbox-simulator-basic' |
274 | 273 | - host.state == 'Up' |
275 | | - - host.name == '{{ host_hostname }}' |
276 | | - - host.host_tags == ['perf', 'gpu', 'x2'] |
| 274 | + - host.name == host_hostname |
| 275 | + - host.host_tags|sort == ['gpu', 'perf', 'x2'] |
277 | 276 |
|
278 | 277 | - name: test put host in maintenance |
279 | | - cs_host: |
| 278 | + ngine_io.cloudstack.host: |
280 | 279 | name: "{{ host_hostname }}" |
281 | 280 | zone: "{{ cs_common_zone_basic }}" |
282 | 281 | cluster: C0-basic |
|
293 | 292 | - host.allocation_state == 'maintenance' |
294 | 293 | - host.zone == 'Sandbox-simulator-basic' |
295 | 294 | - host.state == 'Up' |
296 | | - - host.name == '{{ host_hostname }}' |
297 | | - - host.host_tags == ['perf', 'gpu', 'x2'] |
| 295 | + - host.name == host_hostname |
| 296 | + - host.host_tags|sort == ['gpu', 'perf', 'x2'] |
298 | 297 |
|
299 | 298 | - name: test put host in maintenance idempotence |
300 | | - cs_host: |
| 299 | + ngine_io.cloudstack.host: |
301 | 300 | name: "{{ host_hostname }}" |
302 | 301 | zone: "{{ cs_common_zone_basic }}" |
303 | 302 | cluster: C0-basic |
|
314 | 313 | - host.allocation_state == 'maintenance' |
315 | 314 | - host.zone == 'Sandbox-simulator-basic' |
316 | 315 | - host.state == 'Up' |
317 | | - - host.name == '{{ host_hostname }}' |
318 | | - - host.host_tags == ['perf', 'gpu', 'x2'] |
| 316 | + - host.name == host_hostname |
| 317 | + - host.host_tags|sort == ['gpu', 'perf', 'x2'] |
319 | 318 |
|
320 | 319 | - name: test put host out of maintenance in check mode |
321 | | - cs_host: |
| 320 | + ngine_io.cloudstack.host: |
322 | 321 | name: "{{ host_hostname }}" |
323 | 322 | zone: "{{ cs_common_zone_basic }}" |
324 | 323 | cluster: C0-basic |
|
336 | 335 | - host.allocation_state == 'maintenance' |
337 | 336 | - host.zone == 'Sandbox-simulator-basic' |
338 | 337 | - host.state == 'Up' |
339 | | - - host.name == '{{ host_hostname }}' |
340 | | - - host.host_tags == ['perf', 'gpu', 'x2'] |
| 338 | + - host.name == host_hostname |
| 339 | + - host.host_tags|sort == ['gpu', 'perf', 'x2'] |
341 | 340 |
|
342 | 341 | - name: test put host out of maintenance |
343 | | - cs_host: |
| 342 | + ngine_io.cloudstack.host: |
344 | 343 | name: "{{ host_hostname }}" |
345 | 344 | zone: "{{ cs_common_zone_basic }}" |
346 | 345 | cluster: C0-basic |
|
357 | 356 | - host.allocation_state == 'enabled' |
358 | 357 | - host.zone == 'Sandbox-simulator-basic' |
359 | 358 | - host.state == 'Up' |
360 | | - - host.name == '{{ host_hostname }}' |
361 | | - - host.host_tags == ['perf', 'gpu', 'x2'] |
| 359 | + - host.name == host_hostname |
| 360 | + - host.host_tags|sort == ['gpu', 'perf', 'x2'] |
362 | 361 |
|
363 | 362 | - name: test put host out of maintenance idempotence |
364 | | - cs_host: |
| 363 | + ngine_io.cloudstack.host: |
365 | 364 | name: "{{ host_hostname }}" |
366 | 365 | zone: "{{ cs_common_zone_basic }}" |
367 | 366 | cluster: C0-basic |
|
378 | 377 | - host.allocation_state == 'enabled' |
379 | 378 | - host.zone == 'Sandbox-simulator-basic' |
380 | 379 | - host.state == 'Up' |
381 | | - - host.name == '{{ host_hostname }}' |
382 | | - - host.host_tags == ['perf', 'gpu', 'x2'] |
| 380 | + - host.name == host_hostname |
| 381 | + - host.host_tags|sort == ['gpu', 'perf', 'x2'] |
383 | 382 |
|
384 | 383 | - name: test remove host in check mode |
385 | | - cs_host: |
| 384 | + ngine_io.cloudstack.host: |
386 | 385 | name: "{{ host_hostname }}" |
387 | 386 | zone: "{{ cs_common_zone_basic }}" |
388 | 387 | cluster: C0-basic |
|
400 | 399 | - host.allocation_state == 'enabled' |
401 | 400 | - host.zone == 'Sandbox-simulator-basic' |
402 | 401 | - host.state == 'Up' |
403 | | - - host.name == '{{ host_hostname }}' |
404 | | - - host.host_tags == ['perf', 'gpu', 'x2'] |
| 402 | + - host.name == host_hostname |
| 403 | + - host.host_tags|sort == ['gpu', 'perf', 'x2'] |
405 | 404 |
|
406 | 405 | - name: test remove host |
407 | | - cs_host: |
| 406 | + ngine_io.cloudstack.host: |
408 | 407 | name: "{{ host_hostname }}" |
409 | 408 | zone: "{{ cs_common_zone_basic }}" |
410 | 409 | cluster: C0-basic |
|
421 | 420 | - host.allocation_state == 'enabled' |
422 | 421 | - host.zone == 'Sandbox-simulator-basic' |
423 | 422 | - host.state == 'Up' |
424 | | - - host.name == '{{ host_hostname }}' |
425 | | - - host.host_tags == ['perf', 'gpu', 'x2'] |
| 423 | + - host.name == host_hostname |
| 424 | + - host.host_tags|sort == ['gpu', 'perf', 'x2'] |
426 | 425 |
|
427 | 426 | - name: test remove host idempotence |
428 | | - cs_host: |
| 427 | + ngine_io.cloudstack.host: |
429 | 428 | name: "{{ host_hostname }}" |
430 | 429 | zone: "{{ cs_common_zone_basic }}" |
431 | 430 | cluster: C0-basic |
|
0 commit comments