mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 12:33:59 -07:00
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.
This commit is contained in:
parent
81f211c995
commit
e635dc6969
4 changed files with 164 additions and 0 deletions
|
@ -0,0 +1,3 @@
|
|||
vultr_block_storage_name: ansibletest-volume
|
||||
vultr_block_storage_size: 10
|
||||
vultr_block_storage_region: New Jersey
|
33
test/legacy/roles/vultr_block_storage_facts/tasks/main.yml
Normal file
33
test/legacy/roles/vultr_block_storage_facts/tasks/main.yml
Normal file
|
@ -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
|
|
@ -7,6 +7,7 @@
|
|||
roles:
|
||||
- { role: vultr_account_facts, tags: test_vultr_account_facts }
|
||||
- { role: vultr_block_storage, tags: test_vultr_block_storage }
|
||||
- { role: vultr_block_storage_facts, tags: test_vultr_block_storage_facts }
|
||||
- { role: vultr_dns_domain, tags: test_vultr_dns_domain }
|
||||
- { role: vultr_dns_domain_facts, tags: test_vultr_dns_domain_facts }
|
||||
- { role: vultr_dns_record, tags: test_vultr_dns_record }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue