diff options
author | Yanis Guenane <yguenane@gmail.com> | 2018-07-19 11:02:25 +0200 |
---|---|---|
committer | René Moser <mail@renemoser.net> | 2018-07-19 11:02:25 +0200 |
commit | 1754f533b5efd0ca4347f54dcf58fbd0cb168d0a (patch) | |
tree | e5e76584452293de7d1a6ef13392c9bde1804297 /test | |
parent | Vultr: Introducing vr_dns_domain_facts module (#42994) (diff) | |
download | ansible-1754f533b5efd0ca4347f54dcf58fbd0cb168d0a.tar.xz ansible-1754f533b5efd0ca4347f54dcf58fbd0cb168d0a.zip |
Vultr: Introducing vr_firewall_group_facts module (#42997)
This commit introduces a new module called vr_firewall_group_facts.
This module aims to return the list of firewall groups avaiable
avaiable in Vultr.
Sample available here:
```
"vultr_firewall_group_facts": [
{
"date_created": "2018-07-17 12:22:51",
"date_modified": "2018-07-17 12:24:47",
"description": "ansible-firewall-group",
"id": "fb5a0876",
"instance_count": 0,
"max_rule_count": 50,
"rule_count": 1
}
]
```
Diffstat (limited to 'test')
-rw-r--r-- | test/legacy/roles/vr_firewall_group_facts/defaults/main.yml | 1 | ||||
-rw-r--r-- | test/legacy/roles/vr_firewall_group_facts/tasks/main.yml | 28 | ||||
-rw-r--r-- | test/legacy/vultr.yml | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/test/legacy/roles/vr_firewall_group_facts/defaults/main.yml b/test/legacy/roles/vr_firewall_group_facts/defaults/main.yml new file mode 100644 index 0000000000..18d55d2853 --- /dev/null +++ b/test/legacy/roles/vr_firewall_group_facts/defaults/main.yml @@ -0,0 +1 @@ +firewall_group_name: mytestfirewallgroup diff --git a/test/legacy/roles/vr_firewall_group_facts/tasks/main.yml b/test/legacy/roles/vr_firewall_group_facts/tasks/main.yml new file mode 100644 index 0000000000..80639ab89c --- /dev/null +++ b/test/legacy/roles/vr_firewall_group_facts/tasks/main.yml @@ -0,0 +1,28 @@ +# 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: Create the firewall group + vr_firewall_group: + name: '{{ firewall_group_name }}' + +- name: test gather vultr firewall group facts in check mode + vr_firewall_group_facts: + check_mode: yes + +- name: verify test gather vultr firewall group facts in check mode + assert: + that: + - ansible_facts.vultr_firewall_group_facts|selectattr('description','equalto','{{ firewall_group_name }}') | list | count == 1 + +- name: test gather vultr firewall group facts + vr_firewall_group_facts: + +- name: verify test gather vultr firewall group facts + assert: + that: + - ansible_facts.vultr_firewall_group_facts|selectattr('description','equalto','{{ firewall_group_name }}') | list | count == 1 + +- name: Delete the firewall group + vr_firewall_group: + name: '{{ firewall_group_name }}' + state: absent diff --git a/test/legacy/vultr.yml b/test/legacy/vultr.yml index 05d6c8e812..c6d90a760a 100644 --- a/test/legacy/vultr.yml +++ b/test/legacy/vultr.yml @@ -10,6 +10,7 @@ - { role: vr_dns_domain_facts, tags: test_vr_dns_domain_facts } - { role: vr_dns_record, tags: test_vr_dns_record } - { role: vr_firewall_group, tags: test_vr_firewall_group } + - { role: vr_firewall_group_facts, tags: test_vr_firewall_group_facts } - { role: vr_firewall_rule, tags: test_vr_firewall_rule } - { role: vr_os_facts, tags: test_vr_os_facts } - { role: vr_plan_facts, tags: test_vr_plan_facts } |