summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorLukas Kämmerling <4281581+LKaemmerling@users.noreply.github.com>2019-03-27 11:52:31 +0100
committerRené Moser <mail@renemoser.net>2019-03-27 11:52:31 +0100
commit3614f78bc5cd4883053a82e42ecae286623cf968 (patch)
tree7b1342ee08a9bcccfd9d4f42e20ebd0f1acdb963 /test/integration
parentAdd hcloud_datacenter_facts module (#53851) (diff)
downloadansible-3614f78bc5cd4883053a82e42ecae286623cf968.tar.xz
ansible-3614f78bc5cd4883053a82e42ecae286623cf968.zip
Add hcloud_server_type_facts module (#53852)
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/targets/hcloud_server_type_facts/aliases2
-rw-r--r--test/integration/targets/hcloud_server_type_facts/defaults/main.yml5
-rw-r--r--test/integration/targets/hcloud_server_type_facts/tasks/main.yml34
3 files changed, 41 insertions, 0 deletions
diff --git a/test/integration/targets/hcloud_server_type_facts/aliases b/test/integration/targets/hcloud_server_type_facts/aliases
new file mode 100644
index 0000000000..51742ee23f
--- /dev/null
+++ b/test/integration/targets/hcloud_server_type_facts/aliases
@@ -0,0 +1,2 @@
+cloud/hcloud
+unsupported
diff --git a/test/integration/targets/hcloud_server_type_facts/defaults/main.yml b/test/integration/targets/hcloud_server_type_facts/defaults/main.yml
new file mode 100644
index 0000000000..05502aa91b
--- /dev/null
+++ b/test/integration/targets/hcloud_server_type_facts/defaults/main.yml
@@ -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
diff --git a/test/integration/targets/hcloud_server_type_facts/tasks/main.yml b/test/integration/targets/hcloud_server_type_facts/tasks/main.yml
new file mode 100644
index 0000000000..c0d2e50296
--- /dev/null
+++ b/test/integration/targets/hcloud_server_type_facts/tasks/main.yml
@@ -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