Ansible role to install and configure CoreDNS server.
Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.
- Minimum Ansible version:
2.10
List of default zone file definitions
coredns_default_zones: []
coredns_default_zones:
- name: example.org
plugins:
- name: prometheus
- name: log
- name: errors
- name: chaos
args: CoreDNS-001 [email protected]
- name: dnssec
config: |
key file Kexample.org.+013+45330
content: |
$ORIGIN example.org.
@ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
2017042745 ; serial
7200 ; refresh (2 hours)
3600 ; retry (1 hour)
1209600 ; expire (2 weeks)
3600 ; minimum (1 hour)
)
3600 IN NS a.iana-servers.net.
3600 IN NS b.iana-servers.net.
www IN A 127.0.0.1
IN AAAA ::1
- name: example.de
url: http://example.com/example-zone
- name: example.eu
src: path/to/template.j2
- name: example.org
state: absent
URL to the archive of the release to install
coredns_download: https://github.com/coredns/coredns/releases/download/v{{ coredns_version
}}/coredns_{{ coredns_version }}_linux_amd64.tgz
List of extra zone file definitions
coredns_extra_zones: []
coredns_extra_zones:
- name: example.org
plugins:
- name: prometheus
- name: log
- name: errors
- name: chaos
args: CoreDNS-001 [email protected]
- name: dnssec
config: |
key file Kexample.org.+013+45330
content: |
$ORIGIN example.org.
@ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
2017042745 ; serial
7200 ; refresh (2 hours)
3600 ; retry (1 hour)
1209600 ; expire (2 weeks)
3600 ; minimum (1 hour)
)
3600 IN NS a.iana-servers.net.
3600 IN NS b.iana-servers.net.
www IN A 127.0.0.1
IN AAAA ::1
- name: example.de
url: http://example.com/example-zone
- name: example.eu
src: path/to/template.j2
- name: example.org
state: absent
Optional raw config to overwrite the Corefile
coredns_general_config:
Enable the default zone part of core config
coredns_general_enabled: true
Zone for the general standard configuration
coredns_general_name: .
List of plugins for standard configuration
coredns_general_plugins:
- name: errors
- name: log
- name: prometheus
- name: hosts
- name: forward
args: . 8.8.8.8 1.1.1.1
- name: cache
args: 30
- name: loop
- name: loadbalance
coredns_general_plugins:
- name: errors
- name: log
- name: prometheus
- name: chaos
args: CoreDNS-001 [email protected]
- name: cache
args: 30
- name: loop
- name: loadbalance
Override the port binding for CoreDNS
coredns_listen_port:
Version of the release to install
coredns_version: 1.11.4
coredns
- None
Apache-2.0