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/hcloud_server/tasks/validation.yml
Julian Tölle 23c2d7d228
ci: ubuntu-18.04 is deprecated/EOL (#224)
Update all references to ubuntu-18.04 (and 20.04) to 22.04, as ubuntu
18.04 is EOL and deprecated in Hetzner Cloud. This causes a CI failure
in the main branch:

https://dev.azure.com/ansible/hetzner.hcloud/_build/results?buildId=80941&view=logs&j=fdb818b8-39d8-529a-d9da-324e304604bc&t=2d52cce2-88ce-5057-da88-145e92cee00f&l=1094
2023-06-20 11:38:51 +02:00

51 lines
1.5 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: setup
hcloud_server:
name: "{{ hcloud_server_name }}"
state: absent
register: result
- name: verify setup
assert:
that:
- result is success
- name: test missing required parameters on create server
hcloud_server:
name: "{{ hcloud_server_name }}"
register: result
ignore_errors: yes
- name: verify fail test missing required parameters on create server
assert:
that:
- result is failed
- 'result.msg == "missing required arguments: server_type, image"'
- name: test create server with not existing server type
hcloud_server:
name: "{{ hcloud_server_name }}"
server_type: not-existing-server-type
image: ubuntu-22.04
state: present
register: result
ignore_errors: yes
- name: verify fail test create server with not existing server type
assert:
that:
- result is failed
- 'result.msg == "server_type not-existing-server-type was not found"'
- name: test create server with not existing image
hcloud_server:
name: "{{ hcloud_server_name }}"
server_type: cx11
image: my-not-existing-image-20.04
state: present
register: result
ignore_errors: yes
- name: verify fail test create server with not existing image
assert:
that:
- result is failed
- 'result.msg == "Image my-not-existing-image-20.04 was not found"'