Debian Codegraph @

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

raw
1 ---
2 - name: Fail missing params
3 cloudscale_ch.cloud.server:
4 register: srv
5 ignore_errors: True
6 - name: 'VERIFY: Fail name and UUID'
7 assert:
8 that:
9 - srv is failed
10
11 - name: Fail unexisting server group
12 cloudscale_ch.cloud.server:
13 name: '{{ cloudscale_resource_prefix }}-test-group'
14 flavor: '{{ cloudscale_test_flavor }}'
15 image: '{{ cloudscale_test_image }}'
16 password: '{{ cloudscale_test_password }}'
17 server_groups: '{{ cloudscale_resource_prefix }}-unexist-group'
18 ignore_errors: True
19 register: srv
20 - name: 'VERIFY: Fail unexisting server group'
21 assert:
22 that:
23 - srv is failed
24 - srv.msg.startswith('Server group name or UUID not found')
25
26 - name: Create two server groups with the same name
27 uri:
28 url: https://api.cloudscale.ch/v1/server-groups
29 method: POST
30 headers:
31 Authorization: 'Bearer {{ cloudscale_api_token }}'
32 body:
33 name: '{{ cloudscale_resource_prefix }}-duplicate'
34 type: anti-affinity
35 body_format: json
36 status_code: 201
37 register: duplicate
38 with_sequence: count=2
39
40 - name: Try to use server groups with identical name
41 cloudscale_ch.cloud.server:
42 name: '{{ cloudscale_resource_prefix }}-test-group'
43 flavor: '{{ cloudscale_test_flavor }}'
44 image: '{{ cloudscale_test_image }}'
45 password: '{{ cloudscale_test_password }}'
46 server_groups: '{{ cloudscale_resource_prefix }}-duplicate'
47 ignore_errors: True
48 register: srv
49 - name: 'VERIFY: Fail unexisting server group'
50 assert:
51 that:
52 - srv is failed
53 - srv.msg.startswith('More than one server group with name exists')