1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00
hetzner.hcloud/tests/integration/targets/datacenter_info/tasks/test.yml
Jonas L 933a16249b
feat: remove hcloud_ prefix from all modules names (#390)
##### SUMMARY

This simplifies the name of the modules from
`hetzner.hcloud.hcloud_firewall` to `hetzner.hcloud.firewall`. While
maintaining backward compatibility with the old names.

Further changes such as updating the test or the documentation will be
done in a future PR to maintain the git history when squashing the PRs.

##### ISSUE TYPE

- Feature Pull Request
2023-11-20 13:21:23 +01:00

58 lines
2 KiB
YAML

# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
---
- name: Gather hcloud_datacenter_info
hetzner.hcloud.hcloud_datacenter_info:
register: result
- name: Verify hcloud_datacenter_info
ansible.builtin.assert:
that:
- result.hcloud_datacenter_info | list | count >= 5
- name: Gather hcloud_datacenter_info in check mode
hetzner.hcloud.hcloud_datacenter_info:
check_mode: true
register: result
- name: Verify hcloud_datacenter_info in check mode
ansible.builtin.assert:
that:
- result.hcloud_datacenter_info | list | count >= 5
- name: Gather hcloud_datacenter_info with correct id
hetzner.hcloud.hcloud_datacenter_info:
id: "{{ hcloud_datacenter_id }}"
register: result
- name: Verify hcloud_datacenter_info with correct id
ansible.builtin.assert:
that:
- result.hcloud_datacenter_info | list | count == 1
- result.hcloud_datacenter_info[0].name == hcloud_datacenter_name
- result.hcloud_datacenter_info[0].location == hcloud_location_name
- name: Gather hcloud_datacenter_info with wrong id
hetzner.hcloud.hcloud_datacenter_info:
id: "{{ hcloud_datacenter_id }}4321"
ignore_errors: true
register: result
- name: Verify hcloud_datacenter_info with wrong id
ansible.builtin.assert:
that:
- result is failed
- name: Gather hcloud_datacenter_info with correct name
hetzner.hcloud.hcloud_datacenter_info:
name: "{{ hcloud_datacenter_name }}"
register: result
- name: Verify hcloud_datacenter_info with correct name
ansible.builtin.assert:
that:
- result.hcloud_datacenter_info | list | count == 1
- name: Gather hcloud_datacenter_info with wrong name
hetzner.hcloud.hcloud_datacenter_info:
name: "{{ hcloud_datacenter_name }}-invalid"
register: result
- name: Verify hcloud_datacenter_info with wrong name
ansible.builtin.assert:
that:
- result.hcloud_datacenter_info | list | count == 0