mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 12:03:58 -07:00
Record set module (#28423)
* Record set module New module to manage DNS Record sets * fix pylint issue * fixed problem with commas * fixed pep issue
This commit is contained in:
parent
78bb48a0f6
commit
ddbdf0fd5d
4 changed files with 757 additions and 0 deletions
3
test/integration/targets/azure_rm_dnsrecordset/aliases
Normal file
3
test/integration/targets/azure_rm_dnsrecordset/aliases
Normal file
|
@ -0,0 +1,3 @@
|
|||
cloud/azure
|
||||
posix/ci/cloud/azure
|
||||
destructive
|
|
@ -0,0 +1,2 @@
|
|||
dependencies:
|
||||
- setup_azure
|
124
test/integration/targets/azure_rm_dnsrecordset/tasks/main.yml
Normal file
124
test/integration/targets/azure_rm_dnsrecordset/tasks/main.yml
Normal file
|
@ -0,0 +1,124 @@
|
|||
- name: Create a DNS zone
|
||||
azure_rm_dnszone:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testing01010.com
|
||||
state: present
|
||||
register: results
|
||||
|
||||
- name: Assert that DNS zone was created
|
||||
assert:
|
||||
that: results.changed
|
||||
|
||||
- name: create new "A" record set with multiple records
|
||||
azure_rm_dnsrecordset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
relative_name: www
|
||||
zone_name: testing01010.com
|
||||
record_type: A
|
||||
record_set_state: present
|
||||
record_state: present
|
||||
records:
|
||||
- 192.168.100.101
|
||||
- 192.168.100.102
|
||||
- 192.168.100.103
|
||||
register: results
|
||||
|
||||
- name: Assert that A record set was created
|
||||
assert:
|
||||
that: results.changed
|
||||
|
||||
- name: Update "A" record set with additional record
|
||||
azure_rm_dnsrecordset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
relative_name: www
|
||||
zone_name: testing01010.com
|
||||
record_type: A
|
||||
record_set_state: present
|
||||
record_state: present
|
||||
records:
|
||||
- 192.168.100.104
|
||||
register: results
|
||||
|
||||
- name: Assert that new record was appended
|
||||
assert:
|
||||
that:
|
||||
- results.changed
|
||||
- results.record_set_state.full_list[3] == '192.168.100.104'
|
||||
|
||||
- name: Check_mode test
|
||||
azure_rm_dnsrecordset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
relative_name: www
|
||||
zone_name: testing01010.com
|
||||
record_type: A
|
||||
record_set_state: present
|
||||
record_state: present
|
||||
records:
|
||||
- 192.168.100.105
|
||||
check_mode: yes
|
||||
register: results
|
||||
|
||||
- name: Assert that check_mode returns new state
|
||||
assert:
|
||||
that:
|
||||
- results.changed
|
||||
- results.check_mode
|
||||
|
||||
- name: Remove 1 record from record set
|
||||
azure_rm_dnsrecordset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
relative_name: www
|
||||
zone_name: testing01010.com
|
||||
record_type: A
|
||||
record_set_state: present
|
||||
record_state: absent
|
||||
records:
|
||||
- 192.168.100.104
|
||||
register: results
|
||||
|
||||
- name: Assert that record was deleted
|
||||
assert:
|
||||
that:
|
||||
- results.changed
|
||||
|
||||
- name: delete a record set
|
||||
azure_rm_dnsrecordset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
relative_name: www
|
||||
zone_name: testing01010.com
|
||||
record_type: A
|
||||
record_set_state: absent
|
||||
register: results
|
||||
|
||||
- name: Assert that record set deleted
|
||||
assert:
|
||||
that: results.changed
|
||||
|
||||
- name: create SRV records in a new record set
|
||||
azure_rm_dnsrecordset:
|
||||
resource_group: "{{ resource_group }}"
|
||||
relative_name: _sip._tcp.testing.com
|
||||
zone_name: testing01010.com
|
||||
record_type: SRV
|
||||
record_set_state: present
|
||||
records: sip.testing01010.com
|
||||
preference: 10
|
||||
record_state: present
|
||||
time_to_live: 7200
|
||||
priority: 20
|
||||
weight: 10
|
||||
port: 5060
|
||||
register: results
|
||||
|
||||
- name: Assert that SRV record set was created
|
||||
assert:
|
||||
that:
|
||||
- results.changed
|
||||
- results.record_set_state.full_list[0] == 'sip.testing01010.com'
|
||||
- results.record_set_state.name == '_sip._tcp.testing.com'
|
||||
|
||||
- name: Delete DNS zone
|
||||
azure_rm_dnszone:
|
||||
resource_group: "{{ resource_group }}"
|
||||
name: testing01010.com
|
||||
state: absent
|
Loading…
Add table
Add a link
Reference in a new issue