community.dns.hetzner_dns_record_sets – Bulk synchronize DNS record sets in Hetzner DNS service
This plugin is part of the community.dns collection (version 2.0.3).
You might already have this collection installed if you are using the
It is not included in
To check whether it is installed, run
ansible-galaxy collection list.
To install it, use:
ansible-galaxy collection install community.dns.
To use it in a playbook, specify:
New in version 2.0.0: of community.dns
Bulk synchronize DNS record sets in Hetzner DNS service.
It is possible to ignore certain record sets by specifying ignore: true for that record set.
The module allows to set, modify and delete multiple DNS record sets at once.
With the purge option, it is also possible to delete existing record sets that are not mentioned in the module parameters. With this, it is possible to synchronize the expected state of a DNS zone with the expected state.
- name: Make sure some records exist and have the expected values community.dns.hetzner_dns_record_sets: zone: foo.com records: - prefix: new type: A ttl: 7200 value: - 22.214.171.124 - 126.96.36.199 - prefix: new type: AAAA ttl: 7200 value: - "::1" - record: foo.com type: TXT value: - test hetzner_token: access_token - name: Synchronize DNS zone with a fixed set of records # If a record exists that is not mentioned here, it will be deleted community.dns.hetzner_dns_record_sets: zone_id: 23 purge: true records: - prefix: '' type: A value: 127.0.0.1 - prefix: '' type: AAAA value: "::1" - prefix: '' type: NS value: - ns-1.hoster.com - ns-2.hoster.com - ns-3.hoster.com hetzner_token: access_token