mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 12:03:58 -07:00
new facts module for dns zone (#28803)
* new facts module for dns zone integration tests and new module for dns zone facts * use vairable for domain name * add nondeterministic piece to domain name * fix azure_rm_dnszone_facts examples
This commit is contained in:
parent
950165ba70
commit
3045c58c83
4 changed files with 220 additions and 0 deletions
3
test/integration/targets/azure_rm_dnszone_facts/aliases
Normal file
3
test/integration/targets/azure_rm_dnszone_facts/aliases
Normal file
|
@ -0,0 +1,3 @@
|
|||
cloud/azure
|
||||
posix/ci/cloud/azure
|
||||
destructive
|
|
@ -0,0 +1,2 @@
|
|||
dependencies:
|
||||
- setup_azure
|
|
@ -0,0 +1,34 @@
|
|||
- name: Create random domain name
|
||||
set_fact:
|
||||
domain_name: "{{ resource_group | hash('md5') | truncate(16, True, '') + (65535 | random | string) }}"
|
||||
|
||||
- name: Create a DNS zone
|
||||
azure_rm_dnszone:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ domain_name }}.com"
|
||||
state: present
|
||||
tags:
|
||||
tag1: tag1
|
||||
register: results
|
||||
|
||||
- name: Assert DNS Zone was created
|
||||
assert:
|
||||
that: results.changed
|
||||
|
||||
- name: Retrieve DNS Zone Facts
|
||||
azure_rm_dnszone_facts:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ domain_name }}.com"
|
||||
register: results
|
||||
|
||||
- name: Assert that facts module returned result
|
||||
assert:
|
||||
that:
|
||||
- not results.changed
|
||||
- results.ansible_facts.azure_dnszones[0].tags.tag1 == 'tag1'
|
||||
|
||||
- name: Delete DNS zone
|
||||
azure_rm_dnszone:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: "{{ domain_name }}.com"
|
||||
state: absent
|
Loading…
Add table
Add a link
Reference in a new issue