diff options
author | Yanis Guenane <yguenane@gmail.com> | 2018-07-19 10:13:24 +0200 |
---|---|---|
committer | René Moser <mail@renemoser.net> | 2018-07-19 10:13:24 +0200 |
commit | f6ca231729843d286b1f923297b22818711df843 (patch) | |
tree | bbe2fdc2878d90e976b23a81e092459c61bd8e03 /test/legacy | |
parent | c43e51e39e8d623ae8290c3921928d78feb1885e (diff) | |
download | ansible-f6ca231729843d286b1f923297b22818711df843.tar.gz |
Vultr: Introducing vr_dns_domain_facts module (#42994)
This commit introduces a new module called vr_dns_domain_facts.
This module aims to return the list of DNS domains avaiable avaiable in
Vultr.
Sample available here:
```
"vultr_dns_domain_facts": [
{
"date_created": "2018-07-19 07:31:14",
"domain": "ansibletest.com",
}
]
```
Diffstat (limited to 'test/legacy')
-rw-r--r-- | test/legacy/roles/vr_dns_domain_facts/defaults/main.yml | 2 | ||||
-rw-r--r-- | test/legacy/roles/vr_dns_domain_facts/tasks/main.yml | 30 | ||||
-rw-r--r-- | test/legacy/vultr.yml | 1 |
3 files changed, 33 insertions, 0 deletions
diff --git a/test/legacy/roles/vr_dns_domain_facts/defaults/main.yml b/test/legacy/roles/vr_dns_domain_facts/defaults/main.yml new file mode 100644 index 0000000000..ade6f34217 --- /dev/null +++ b/test/legacy/roles/vr_dns_domain_facts/defaults/main.yml @@ -0,0 +1,2 @@ +dns_domain_name: ansibletest.com +dns_domain_server_ip: 104.24.16.59 diff --git a/test/legacy/roles/vr_dns_domain_facts/tasks/main.yml b/test/legacy/roles/vr_dns_domain_facts/tasks/main.yml new file mode 100644 index 0000000000..9208069015 --- /dev/null +++ b/test/legacy/roles/vr_dns_domain_facts/tasks/main.yml @@ -0,0 +1,30 @@ +# 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 record + vr_dns_domain: + name: '{{ dns_domain_name }}' + server_ip: '{{ dns_domain_server_ip }}' + +- name: test gather vultr dns domain facts in check mode + vr_dns_domain_facts: + check_mode: yes + +- name: verify test gather vultr dns domain facts in check mode + assert: + that: + - ansible_facts.vultr_dns_domain_facts|selectattr('domain','equalto','{{ dns_domain_name }}') | list | count == 1 + +- name: test gather vultr dns domain facts + vr_dns_domain_facts: + +- name: verify test gather vultr dns domain facts + assert: + that: + - ansible_facts.vultr_dns_domain_facts|selectattr('domain','equalto','{{ dns_domain_name }}') | list | count == 1 + +- name: Delete the record + vr_dns_domain: + name: '{{ dns_domain_name }}' + server_ip: '{{ dns_domain_server_ip }}' + state: absent diff --git a/test/legacy/vultr.yml b/test/legacy/vultr.yml index 42bc644d41..05d6c8e812 100644 --- a/test/legacy/vultr.yml +++ b/test/legacy/vultr.yml @@ -7,6 +7,7 @@ roles: - { role: vr_account_facts, tags: test_vr_account_facts } - { role: vr_dns_domain, tags: test_vr_dns_domain } + - { 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_rule, tags: test_vr_firewall_rule } |