summaryrefslogtreecommitdiff
path: root/test/legacy/roles
diff options
context:
space:
mode:
authorYanis Guenane <yguenane@gmail.com>2018-08-17 19:32:13 +0200
committerRené Moser <mail@renemoser.net>2018-08-17 19:32:13 +0200
commite635dc696923ad4c61092ba59543ebdaa85d1804 (patch)
treeb27f640749a99c1aea69dfa154c5845d463ad4ce /test/legacy/roles
parent81f211c995eb1603d42cda3a237bfb1230377cb6 (diff)
downloadansible-e635dc696923ad4c61092ba59543ebdaa85d1804.tar.gz
Vultr: Introducing vultr_block_storage_facts module (#43218)
This commit introduces a new module called vultr_block_storage_facts. This module aims to return the list of block storage volume avaiable in Vultr.
Diffstat (limited to 'test/legacy/roles')
-rw-r--r--test/legacy/roles/vultr_block_storage_facts/defaults/main.yml3
-rw-r--r--test/legacy/roles/vultr_block_storage_facts/tasks/main.yml33
2 files changed, 36 insertions, 0 deletions
diff --git a/test/legacy/roles/vultr_block_storage_facts/defaults/main.yml b/test/legacy/roles/vultr_block_storage_facts/defaults/main.yml
new file mode 100644
index 0000000000..b49589ac6f
--- /dev/null
+++ b/test/legacy/roles/vultr_block_storage_facts/defaults/main.yml
@@ -0,0 +1,3 @@
+vultr_block_storage_name: ansibletest-volume
+vultr_block_storage_size: 10
+vultr_block_storage_region: New Jersey
diff --git a/test/legacy/roles/vultr_block_storage_facts/tasks/main.yml b/test/legacy/roles/vultr_block_storage_facts/tasks/main.yml
new file mode 100644
index 0000000000..40fc0e1d53
--- /dev/null
+++ b/test/legacy/roles/vultr_block_storage_facts/tasks/main.yml
@@ -0,0 +1,33 @@
+# Copyright (c) 2018, Yanis Guenane <yanis+ansible@guenane.org>
+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
+---
+- name: test gather vultr block storage volume facts - empty resource
+ vultr_block_storage_facts:
+
+- name: Create the block storage volume
+ vultr_block_storage:
+ name: '{{ vultr_block_storage_name }}'
+ size: '{{ vultr_block_storage_size }}'
+ region: '{{ vultr_block_storage_region }}'
+
+- name: test gather vultr block storage volume facts in check mode
+ vultr_block_storage_facts:
+ check_mode: yes
+
+- name: verify test gather vultr block storage volume facts in check mode
+ assert:
+ that:
+ - ansible_facts.vultr_block_storage_facts|selectattr('name','equalto','{{ vultr_block_storage_name }}') | list | count == 1
+
+- name: test gather vultr block storage volume facts
+ vultr_block_storage_facts:
+
+- name: verify test gather vultr block storage volume facts
+ assert:
+ that:
+ - ansible_facts.vultr_block_storage_facts|selectattr('name','equalto','{{ vultr_block_storage_name }}') | list | count == 1
+
+- name: Delete the block storage volume
+ vultr_block_storage:
+ name: '{{ vultr_block_storage_name }}'
+ state: absent