Debian Codegraph @

ansible_collections/hetzner/hcloud/tests/integration/targets/location_info/tasks/test.yml

raw symbols SCIP
1 # Copyright: (c) 2019, Hetzner Cloud GmbH <[email protected]>
2 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3 ---
4 - name: Gather hcloud_location_info
5 hetzner.hcloud.location_info:
6 register: result
7 - name: Verify hcloud_location_info
8 ansible.builtin.assert:
9 that:
10 - result.hcloud_location_info | list | count >= 5
11
12 - name: Gather hcloud_location_info in check mode
13 hetzner.hcloud.location_info:
14 check_mode: true
15 register: result
16 - name: Verify hcloud_location_info in check mode
17 ansible.builtin.assert:
18 that:
19 - result.hcloud_location_info | list | count >= 5
20
21 - name: Gather hcloud_location_info with correct id
22 hetzner.hcloud.location_info:
23 id: "{{ hcloud_location_id }}"
24 register: result
25 - name: Verify hcloud_location_info with correct id
26 ansible.builtin.assert:
27 that:
28 - result.hcloud_location_info | list | count == 1
29
30 - name: Gather hcloud_location_info with wrong id
31 hetzner.hcloud.location_info:
32 id: "{{ hcloud_location_id }}4321"
33 ignore_errors: true
34 register: result
35 - name: Verify hcloud_location_info with wrong id
36 ansible.builtin.assert:
37 that:
38 - result is failed
39
40 - name: Gather hcloud_location_info with correct name
41 hetzner.hcloud.location_info:
42 name: "{{ hcloud_location_name }}"
43 register: result
44 - name: Verify hcloud_location_info with correct name
45 ansible.builtin.assert:
46 that:
47 - result.hcloud_location_info | list | count == 1
48
49 - name: Gather hcloud_location_info with wrong name
50 hetzner.hcloud.location_info:
51 name: "{{ hcloud_location_name }}-invalid"
52 register: result
53 - name: Verify hcloud_location_info with wrong name
54 ansible.builtin.assert:
55 that:
56 - result.hcloud_location_info | list | count == 0