mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
##### SUMMARY Update all references to modules to use the new module names. Continuation of #390
73 lines
2.4 KiB
YAML
73 lines
2.4 KiB
YAML
# Copyright: (c) 2023, 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_iso_info
|
|
hetzner.hcloud.iso_info:
|
|
register: result
|
|
- name: Verify hcloud_iso_info
|
|
ansible.builtin.assert:
|
|
that:
|
|
- result.hcloud_iso_info | list | count >= 1
|
|
|
|
- name: Gather hcloud_iso_info in check mode
|
|
hetzner.hcloud.iso_info:
|
|
check_mode: true
|
|
register: result
|
|
- name: Verify hcloud_iso_info in check mode
|
|
ansible.builtin.assert:
|
|
that:
|
|
- result.hcloud_iso_info | list | count >= 1
|
|
|
|
- name: Gather hcloud_iso_info with correct id
|
|
hetzner.hcloud.iso_info:
|
|
id: "{{ hcloud_iso_id }}"
|
|
register: result
|
|
- name: Verify hcloud_iso_info with correct id
|
|
ansible.builtin.assert:
|
|
that:
|
|
- result.hcloud_iso_info | list | count == 1
|
|
- result.hcloud_iso_info[0].id == "{{ hcloud_iso_id }}"
|
|
- result.hcloud_iso_info[0].name == "{{ hcloud_iso_name }}"
|
|
- result.hcloud_iso_info[0].architecture == "{{ hcloud_iso_architecture }}"
|
|
- result.hcloud_iso_info[0].type == "{{ hcloud_iso_type }}"
|
|
- result.hcloud_iso_info[0].deprecated is none
|
|
- result.hcloud_iso_info[0].deprecation is none
|
|
|
|
- name: Gather hcloud_iso_info with wrong id
|
|
hetzner.hcloud.iso_info:
|
|
id: "{{ hcloud_iso_id }}4321"
|
|
ignore_errors: true
|
|
register: result
|
|
- name: Verify hcloud_iso_info with wrong id
|
|
ansible.builtin.assert:
|
|
that:
|
|
- result is failed
|
|
|
|
- name: Gather hcloud_iso_info with correct name
|
|
hetzner.hcloud.iso_info:
|
|
name: "{{ hcloud_iso_name }}"
|
|
register: result
|
|
- name: Verify hcloud_iso_info with correct name
|
|
ansible.builtin.assert:
|
|
that:
|
|
- result.hcloud_iso_info | list | count == 1
|
|
|
|
- name: Gather hcloud_iso_info with wrong name
|
|
hetzner.hcloud.iso_info:
|
|
name: "{{ hcloud_iso_name }}-invalid"
|
|
register: result
|
|
- name: Verify hcloud_iso_info with wrong name
|
|
ansible.builtin.assert:
|
|
that:
|
|
- result.hcloud_iso_info | list | count == 0
|
|
|
|
- name: Gather hcloud_iso_info with architecture
|
|
hetzner.hcloud.iso_info:
|
|
architecture: arm
|
|
register: result
|
|
- name: Verify hcloud_iso_info with architecture
|
|
ansible.builtin.assert:
|
|
that:
|
|
- result.hcloud_iso_info | list | count > 2
|
|
- result.hcloud_iso_info | selectattr('architecture', 'equalto', 'x86') | list | count == 0
|
|
- result.hcloud_iso_info | selectattr('architecture', 'equalto', 'arm') | list | count > 2
|