Debian Codegraph @

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

raw
1 ---
2 - name: Fail missing params
3 cloudscale_ch.cloud.subnet:
4 register: snet
5 ignore_errors: True
6 - name: 'VERIFY: Fail missing params'
7 assert:
8 that:
9 - snet is failed
10 - snet.msg.startswith("one of the following is required")
11
12 - name: Fail creation with UUID
13 cloudscale_ch.cloud.subnet:
14 uuid: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
15 register: snet
16 ignore_errors: True
17 - name: 'VERIFY: Fail creation with UUID'
18 assert:
19 that:
20 - snet is failed
21 - snet.msg.startswith("state is present but all of the following are missing")
22
23 - name: Fail creation unknown network name
24 cloudscale_ch.cloud.subnet:
25 cidr: '{{ cloudscale_subnet_cidr }}'
26 network:
27 name: '{{ cloudscale_resource_prefix }}-does-not-exist'
28 tags:
29 project: ansible-test
30 stage: production
31 sla: 24-7
32 register: snet
33 ignore_errors: True
34 - name: 'VERIFY: Fail creation unknown network name'
35 assert:
36 that:
37 - snet is failed
38 - snet.msg.startswith("Network with 'name' not found")
39
40 - name: Fail creation unknown network uuid
41 cloudscale_ch.cloud.subnet:
42 cidr: '{{ cloudscale_subnet_cidr }}'
43 network:
44 uuid: 'f0bb5270-f66c-41d6-ac3b-a223cd280ced'
45 tags:
46 project: ansible-test
47 stage: production
48 sla: 24-7
49 register: snet
50 ignore_errors: True
51 - name: 'VERIFY: Fail creation unknown network uuid'
52 assert:
53 that:
54 - snet is failed
55 - snet.msg.startswith("Network with 'uuid' not found")
56
57 - name: Create two networks with the same name
58 uri:
59 url: 'https://api.cloudscale.ch/v1/networks'
60 method: POST
61 headers:
62 Authorization: 'Bearer {{ cloudscale_api_token }}'
63 body:
64 name: '{{ cloudscale_resource_prefix }}-duplicate'
65 auto_create_ipv4_subnet: False
66 body_format: json
67 status_code: 201
68 register: duplicate
69 with_sequence: count=2
70
71 - name: Try access to duplicate network name
72 cloudscale_ch.cloud.subnet:
73 cidr: '{{ cloudscale_subnet_cidr }}'
74 network:
75 name: '{{ cloudscale_resource_prefix }}-duplicate'
76 register: snet
77 ignore_errors: True
78 - name: 'VERIFY: Try access to duplicate network name'
79 assert:
80 that:
81 - snet is failed
82 - snet.msg.startswith("Multiple networks with 'name' not found")