coredns

Ansible Role: CoreDNS

MIT licensed Galaxy Role Downloads

Installs CoreDNS on Linux and configure the service and template DNS zones.

Requirements

None.

Role Variables

Variable Type Description
coredns_version string Version of CoreDNS to install
coredns_dns_port number Listen port of CoreDNS service
coredns_forwarders list(string) List of DNS server where to forward request if CoreDNS server don't have the answer
coredns_acls list(object) List of acls object defining who can/can't make DNS queries through the CoreDNS instance
coredns_zones list(object) Liste of zone object defining DNS zone where the CoreDNS server have authority
coredns_cache_prefetch object Parameters to configure cache prefetch of the CoreDNS cache plugin
coredns_cache_serve_stale object Parameters to configure cache serve stale of the CoreDNS cache plugin
coredns_ttl object Parameters to configure cache TTL of the CoreDNS cache plugin

ACL

This section explain how to configure the CoreDNS acl plugin using the coredns_acls variable. A CoreDNS acl define who can/can't make DNS queries through the CoreDNS instance.

Each acl is defined with the following attributes :

Attribute Type Description
cidr string An IP CIDR (@IP or range)
action string Action to apply when a client from that CIDR make a query

Zone

This section explain how to configure zones using the CoreDNS file plugin using the coredns_zones variable. Each zone is defined with the following attributes :

Attribute Type Description
name string The name of the DNS zone
zone string Hostname of the zone (example.org for example)
file string The name of the zone database file
template string Path of the zone database template file

Dependencies

None.

Example Playbook

- hosts: localhost
  vars:
    coredns_forwarders:
      - 9.9.9.9
    coredns_acls:
      - cidr: 192.168.0.0/24
        action: allow
    coredns_zones:
      - name: my-zone
        zone: my-zone.fr
        file: db.my-zone.fr
        template: templates/dbs/my-zone.fr
  roles:
    - lunik.coredns

License

MIT

Author Information

This role was created in 2019 by Lunik (Guillaume MARTINEZ).

Maintainer(s)

About

Install and configure CoreDNS service

Install
ansible-galaxy install Lunik/ansible_role_coredns
GitHub repository
License
mit
Downloads
123
Owner
Ansible, GitLab, k8s/helm, Terraform, OCI Contributor