mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Add hcloud_location_facts module (#53848)
This commit is contained in:
committed by
René Moser
parent
cdb1d02f4c
commit
6220eafb73
2
test/integration/targets/hcloud_location_facts/aliases
Normal file
2
test/integration/targets/hcloud_location_facts/aliases
Normal file
@@ -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_location_name: "fsn1"
|
||||
hcloud_location_id: 1
|
||||
@@ -0,0 +1,52 @@
|
||||
# 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 location facts
|
||||
hcloud_location_facts:
|
||||
|
||||
- name: verify test gather hcloud location facts
|
||||
assert:
|
||||
that:
|
||||
- ansible_facts.hcloud_location_facts| list | count == 3
|
||||
|
||||
- name: test gather hcloud location facts in check mode
|
||||
hcloud_location_facts:
|
||||
check_mode: yes
|
||||
|
||||
- name: verify test gather hcloud location facts in check mode
|
||||
assert:
|
||||
that:
|
||||
- ansible_facts.hcloud_location_facts| list | count == 3
|
||||
|
||||
|
||||
- name: test gather hcloud location facts with correct name
|
||||
hcloud_location_facts:
|
||||
name: "{{hcloud_location_name}}"
|
||||
- name: verify test gather hcloud location with correct name
|
||||
assert:
|
||||
that:
|
||||
- ansible_facts.hcloud_location_facts|selectattr('name','equalto','{{ hcloud_location_name }}') | list | count == 1
|
||||
|
||||
- name: test gather hcloud location facts with wrong name
|
||||
hcloud_location_facts:
|
||||
name: "{{hcloud_location_name}}1"
|
||||
- name: verify test gather hcloud location with wrong name
|
||||
assert:
|
||||
that:
|
||||
- ansible_facts.hcloud_location_facts | list | count == 0
|
||||
|
||||
- name: test gather hcloud location facts with correct id
|
||||
hcloud_location_facts:
|
||||
id: "{{hcloud_location_id}}"
|
||||
- name: verify test gather hcloud location with correct id
|
||||
assert:
|
||||
that:
|
||||
- ansible_facts.hcloud_location_facts|selectattr('name','equalto','{{ hcloud_location_name }}') | list | count == 1
|
||||
|
||||
- name: test gather hcloud location facts with wrong id
|
||||
hcloud_location_facts:
|
||||
name: "4711"
|
||||
- name: verify test gather hcloud location with wrong id
|
||||
assert:
|
||||
that:
|
||||
- ansible_facts.hcloud_location_facts | list | count == 0
|
||||
Reference in New Issue
Block a user