mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
consolidate dnszone tests (#45328)
This commit is contained in:
parent
b14206a578
commit
8adc7901ed
5 changed files with 13 additions and 40 deletions
|
@ -1,3 +1,4 @@
|
|||
cloud/azure
|
||||
shippable/azure/group1
|
||||
destructive
|
||||
azure_rm_dnszone_facts
|
||||
|
|
|
@ -42,6 +42,18 @@
|
|||
- results.state.tags.test == 'new_modified'
|
||||
- results.check_mode == true
|
||||
|
||||
- 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.test == 'modified'
|
||||
|
||||
- name: Delete DNS zone
|
||||
azure_rm_dnszone:
|
||||
resource_group: "{{ resource_group }}"
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
cloud/azure
|
||||
shippable/azure/group1
|
||||
shippable/azure/smoketest
|
||||
destructive
|
|
@ -1,2 +0,0 @@
|
|||
dependencies:
|
||||
- setup_azure
|
|
@ -1,34 +0,0 @@
|
|||
- 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…
Reference in a new issue