Getting started

If you run the role without any user-defined variables it will simply install the gdnsd package and enable and start the service. No specific service configuration or DNS zone data will be generated.

Example inventory

The ganto.gdnsd role could be included in your Ansible setup by assigning the DNS host(s) to a custom inventory group such as gdnsd_service. E.g.:

[gdnsd_service]
hostname

The role can be run against multiple hosts (e.g. primary and secondary DNS servers) and it will manage the DNS zone serial to be identical for the same zone data on multiple hosts as long as the zone files are not manually adjusted and zone updates are run concurrently against all servers.

Example playbook

Here’s a minimal example Ansible playbook that uses the ganto.gdnsd role:

---

- name: Manage gdnsd authoritative DNS servers
  hosts: gdnsd_service
  become: True

  roles:
    - role: ganto.gdnsd
      tags: [ 'role::gdnsd' ]

DNS zone configuration

If at least a single domain name is listed in gdnsd__zones the role will create a forward and reverse zone defining the host as primary name server and adds a A and PTR record for the host to the zone files.

gdnsd__zones:
  - domain: example.com

This configuration can be further customized by defining the individual DNS records in the records property of the zone item in gdnsd__zones.