mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-06-10 02:35:54 +00:00
There is a new dnsrecord managem module placed in the plugins folder:
plugins/modules/ipadnsrecord.py
The dnsrecord module allows management of DNS records and is as compatible
as possible with the Ansible upstream `ipa_dnsrecord` module, but provide
some other features like multiple record management in one execution,
support for more DNS record types, and more.
Here is the documentation for the module:
README-dnsrecord
New example playbooks have been added:
playbooks/dnsrecord/ensure-dnsrecord-is-absent.yml
playbooks/dnsrecord/ensure-dnsrecord-is-present.yml
playbooks/dnsrecord/ensure-presence-multiple-records.yml
playbooks/dnsrecord/ensure-dnsrecord-with-reverse-is-present.yml
playbooks/dnsrecord/ensure-multiple-A-records-are-present.yml
playbooks/dnsrecord/ensure-A-and-AAAA-records-are-absent.yml
playbooks/dnsrecord/ensure-A-and-AAAA-records-are-present.yml
playbooks/dnsrecord/ensure-CNAME-record-is-absent.yml
playbooks/dnsrecord/ensure-CNAME-record-is-present.yml
playbooks/dnsrecord/ensure-MX-record-is-present.yml
playbooks/dnsrecord/ensure-PTR-record-is-present.yml
playbooks/dnsrecord/ensure-SRV-record-is-present.yml
playbooks/dnsrecord/ensure-SSHFP-record-is-present.yml
playbooks/dnsrecord/ensure-TLSA-record-is-present.yml
playbooks/dnsrecord/ensure-TXT-record-is-present.yml
playbooks/dnsrecord/ensure-URI-record-is-present.yml
New tests for the module can be found at:
tests/dnsrecord/test_dnsrecord.yml
tests/dnsrecord/test_compatibility_with_ansible_module.yml
tests/dnsrecord/test_dnsrecord_full_records.yml
136 lines
3.8 KiB
YAML
136 lines
3.8 KiB
YAML
---
|
|
# Cleanup tasks.
|
|
- name: Ensure that dns records are absent
|
|
ipadnsrecord:
|
|
ipaadmin_password: SomeADMINpassword
|
|
zone_name: "{{ testzone }}"
|
|
del_all: yes
|
|
name:
|
|
- host01
|
|
- host02
|
|
- host03
|
|
- host04
|
|
- _ftp._tcp
|
|
- _sip._udp
|
|
state: absent
|
|
|
|
- name: Ensure that dns reverse ipv6 records are absent
|
|
ipadnsrecord:
|
|
ipaadmin_password: SomeADMINpassword
|
|
zone_name: ip6.arpa.
|
|
del_all: yes
|
|
name:
|
|
- 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.f
|
|
- 1.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.f
|
|
- 1.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.f
|
|
- 4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.f
|
|
- 4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.f
|
|
- 4.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.f
|
|
state: absent
|
|
|
|
- name: Ensure that dns reverse ipv6 records are absent (workaround)
|
|
ipadnsrecord:
|
|
ipaadmin_password: SomeADMINpassword
|
|
zone_name: "{{ zone_ipv6_reverse_workaround }}"
|
|
del_all: yes
|
|
name:
|
|
- 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
|
|
- 1.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
|
|
- 1.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
|
|
- 4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
|
|
- 4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
|
|
- 4.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
|
|
state: absent
|
|
|
|
- name: Ensure that dns reverse records are absent
|
|
ipadnsrecord:
|
|
ipaadmin_password: SomeADMINpassword
|
|
zone_name: "{{ zone_prefix_reverse_24 }}"
|
|
name:
|
|
- "101"
|
|
- "102"
|
|
- "103"
|
|
- "104"
|
|
- "111"
|
|
- "112"
|
|
- "113"
|
|
- "114"
|
|
- "121"
|
|
- "122"
|
|
- "123"
|
|
- "124"
|
|
del_all: yes
|
|
state: absent
|
|
|
|
- name: Ensure that dns reverse records are absent (workaround 1)
|
|
ipadnsrecord:
|
|
ipaadmin_password: SomeADMINpassword
|
|
zone_name: "{{ zone_prefix_reverse_16 }}"
|
|
name:
|
|
- "101.122"
|
|
- "102.122"
|
|
- "103.122"
|
|
- "104.122"
|
|
- "111.122"
|
|
- "112.122"
|
|
- "113.122"
|
|
- "114.122"
|
|
- "121.122"
|
|
- "122.122"
|
|
- "123.122"
|
|
- "124.122"
|
|
del_all: yes
|
|
state: absent
|
|
|
|
- name: Ensure that dns reverse records are absent (workaround 2)
|
|
ipadnsrecord:
|
|
ipaadmin_password: SomeADMINpassword
|
|
zone_name: "{{ zone_prefix_reverse_8 }}"
|
|
name:
|
|
- "168.101.122"
|
|
- "168.102.122"
|
|
- "168.103.122"
|
|
- "168.104.122"
|
|
- "168.111.122"
|
|
- "168.112.122"
|
|
- "168.113.122"
|
|
- "168.114.122"
|
|
- "168.121.122"
|
|
- "168.122.122"
|
|
- "168.123.122"
|
|
- "168.124.122"
|
|
del_all: yes
|
|
state: absent
|
|
|
|
- name: Ensure that "{{ safezone }}" dns records are absent
|
|
ipadnsrecord:
|
|
ipaadmin_password: SomeADMINpassword
|
|
zone_name: "{{ safezone }}"
|
|
records:
|
|
- name: iron01
|
|
del_all: yes
|
|
state: absent
|
|
|
|
- name: Ensure that NS record for "{{ safezone }}" is absent
|
|
ipadnsrecord:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: iron01
|
|
zone_name: "{{ safezone }}"
|
|
ns_rec: iron01
|
|
state: absent
|
|
|
|
- name: Ensure DNS testing zones are absent.
|
|
ipadnszone:
|
|
ipaadmin_password: SomeADMINpassword
|
|
name: "{{ item }}"
|
|
state: absent
|
|
with_items:
|
|
- "{{ zone_prefix_reverse }}"
|
|
- "{{ zone_prefix_reverse_24 }}"
|
|
- "{{ zone_prefix_reverse_16 }}"
|
|
- "{{ zone_prefix_reverse_8 }}"
|
|
- "{{ testzone }}"
|
|
- ip6.arpa.
|
|
- d.f.ip6.arpa.
|
|
- "{{ safezone }}"
|