1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

cloud_server Improve error handling when using not existing server types (#81)

This commit is contained in:
Lukas Kämmerling 2021-04-22 10:24:41 +02:00 committed by GitHub
parent 04ef10041e
commit c5e8e980f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 4 deletions

View file

@ -20,6 +20,21 @@
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-20.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 }}"