mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Add hcloud_server_type_facts module (#53852)
This commit is contained in:
committed by
René Moser
parent
87554da4d6
commit
3614f78bc5
@@ -0,0 +1,2 @@
|
||||
cloud/hcloud
|
||||
unsupported
|
||||
@@ -0,0 +1,5 @@
|
||||
# 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)
|
||||
---
|
||||
hcloud_server_type_name: "cx11"
|
||||
hcloud_server_type_id: 1
|
||||
@@ -0,0 +1,34 @@
|
||||
# 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: test gather hcloud server type facts
|
||||
hcloud_server_type_facts:
|
||||
- name: verify test gather hcloud server type facts
|
||||
assert:
|
||||
that:
|
||||
- ansible_facts.hcloud_server_type_facts| list | count > 2
|
||||
|
||||
- name: test gather hcloud server type facts in check mode
|
||||
hcloud_server_type_facts:
|
||||
check_mode: yes
|
||||
|
||||
- name: verify test gather hcloud server type facts in check mode
|
||||
assert:
|
||||
that:
|
||||
- ansible_facts.hcloud_server_type_facts| list | count > 2
|
||||
|
||||
- name: test gather hcloud server type facts with name
|
||||
hcloud_server_type_facts:
|
||||
name: "{{hcloud_server_type_name}}"
|
||||
- name: verify test gather hcloud server type with name
|
||||
assert:
|
||||
that:
|
||||
- ansible_facts.hcloud_server_type_facts|selectattr('name','equalto','{{ hcloud_server_type_name }}') | list | count == 1
|
||||
|
||||
- name: test gather hcloud server type facts with correct id
|
||||
hcloud_server_type_facts:
|
||||
id: "{{hcloud_server_type_id}}"
|
||||
- name: verify test gather hcloud server type with correct id
|
||||
assert:
|
||||
that:
|
||||
- ansible_facts.hcloud_server_type_facts|selectattr('name','equalto','{{ hcloud_server_type_name }}') | list | count == 1
|
||||
Reference in New Issue
Block a user