Debian Codegraph @

ansible_collections/cloudscale_ch/cloud/tests/integration/targets/server_group/tasks/failures.yml

raw
1 ---
2 - name: Fail missing params
3 cloudscale_ch.cloud.server_group:
4 register: grp
5 ignore_errors: True
6 - name: 'VERIFY: Fail name and UUID'
7 assert:
8 that:
9 - grp is failed
10
11 - name: Create two server groups with the same name
12 uri:
13 url: 'https://api.cloudscale.ch/v1/server-groups'
14 method: POST
15 headers:
16 Authorization: 'Bearer {{ cloudscale_api_token }}'
17 body:
18 name: '{{ cloudscale_resource_prefix }}-duplicate'
19 type: 'anti-affinity'
20 body_format: json
21 status_code: 201
22 register: duplicate
23 with_sequence: count=2
24
25 - name: Try access to duplicate name
26 cloudscale_ch.cloud.server_group:
27 name: '{{ cloudscale_resource_prefix }}-duplicate'
28 register: grp
29 ignore_errors: True
30 - name: 'VERIFY: Try access to duplicate name'
31 assert:
32 that:
33 - grp is failed
34 - grp.msg.startswith("More than one server-groups resource with 'name' exists")
35
36 - name: Fail server group creation with UUID
37 cloudscale_ch.cloud.server_group:
38 uuid: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
39 register: grp
40 ignore_errors: True
41 - name: 'VERIFY: Fail server group creation with UUID'
42 assert:
43 that:
44 - grp is failed
45 - grp.msg.startswith("state is present but all of the following are missing")