https://github.com/rolehippie/coredns
Ansible role to install and configure CoreDNS server
https://github.com/rolehippie/coredns
ansible ansible-role hacktoberfest role
Last synced: 6 months ago
JSON representation
Ansible role to install and configure CoreDNS server
- Host: GitHub
- URL: https://github.com/rolehippie/coredns
- Owner: rolehippie
- License: apache-2.0
- Created: 2021-11-22T21:18:36.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2026-01-12T09:56:17.000Z (6 months ago)
- Last Synced: 2026-01-12T18:24:26.702Z (6 months ago)
- Topics: ansible, ansible-role, hacktoberfest, role
- Language: Nix
- Homepage:
- Size: 268 KB
- Stars: 6
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# coredns
[](https://github.com/rolehippie/coredns)
[](https://github.com/rolehippie/coredns/actions/workflows/general.yml)
[](https://github.com/rolehippie/coredns/actions/workflows/docs.yml)
[](https://github.com/rolehippie/coredns/actions/workflows/galaxy.yml)
[](https://github.com/rolehippie/coredns/blob/master/LICENSE)
[](https://galaxy.ansible.com/rolehippie/coredns)
Ansible role to install and configure CoreDNS server.
## Sponsor
Building and improving this Ansible role have been sponsored by my current and previous employers like **[Cloudpunks GmbH](https://cloudpunks.de)** and **[Proact Deutschland GmbH](https://www.proact.eu)**.
## Table of contents
- [Requirements](#requirements)
- [Default Variables](#default-variables)
- [coredns_arch](#coredns_arch)
- [coredns_default_zones](#coredns_default_zones)
- [coredns_download](#coredns_download)
- [coredns_extra_zones](#coredns_extra_zones)
- [coredns_general_config](#coredns_general_config)
- [coredns_general_enabled](#coredns_general_enabled)
- [coredns_general_name](#coredns_general_name)
- [coredns_general_plugins](#coredns_general_plugins)
- [coredns_listen_port](#coredns_listen_port)
- [coredns_version](#coredns_version)
- [Discovered Tags](#discovered-tags)
- [Dependencies](#dependencies)
- [License](#license)
- [Author](#author)
---
## Requirements
- Minimum Ansible version: `2.10`
## Default Variables
### coredns_arch
Target system architecture of the binary
#### Default value
```YAML
coredns_arch: "{{ 'arm64' if ansible_architecture == 'aarch64' or ansible_architecture
== 'arm64' else 'amd64' }}"
```
### coredns_default_zones
List of default zone file definitions
#### Default value
```YAML
coredns_default_zones: []
```
#### Example usage
```YAML
coredns_default_zones:
- name: example.org
plugins:
- name: prometheus
- name: log
- name: errors
- name: chaos
args: CoreDNS-001 info@coredns.io
- 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
```
### coredns_download
URL to the archive of the release to install
#### Default value
```YAML
coredns_download: https://github.com/coredns/coredns/releases/download/v{{
coredns_version }}/coredns_{{ coredns_version }}_linux_{{ coredns_arch }}.tgz
```
### coredns_extra_zones
List of extra zone file definitions
#### Default value
```YAML
coredns_extra_zones: []
```
#### Example usage
```YAML
coredns_extra_zones:
- name: example.org
plugins:
- name: prometheus
- name: log
- name: errors
- name: chaos
args: CoreDNS-001 info@coredns.io
- 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
```
### coredns_general_config
Optional raw config to overwrite the Corefile
#### Default value
```YAML
coredns_general_config:
```
### coredns_general_enabled
Enable the default zone part of core config
#### Default value
```YAML
coredns_general_enabled: true
```
### coredns_general_name
Zone for the general standard configuration
#### Default value
```YAML
coredns_general_name: .
```
### coredns_general_plugins
List of plugins for standard configuration
#### Default value
```YAML
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
```
#### Example usage
```YAML
coredns_general_plugins:
- name: errors
- name: log
- name: prometheus
- name: chaos
args: CoreDNS-001 info@coredns.io
- name: cache
args: 30
- name: loop
- name: loadbalance
```
### coredns_listen_port
Override the port binding for CoreDNS
#### Default value
```YAML
coredns_listen_port:
```
### coredns_version
Version of the release to install
#### Default value
```YAML
coredns_version: 1.14.0
```
## Discovered Tags
**_coredns_**
## Dependencies
- None
## License
Apache-2.0
## Author
[Thomas Boerger](https://github.com/tboerger)