Skip to content

Ansible role to install and configure CoreDNS server

License

Notifications You must be signed in to change notification settings

rolehippie/coredns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coredns

Source Code General Workflow Readme Workflow Galaxy Workflow License: Apache-2.0 Ansible Role

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 and Proact Deutschland GmbH.

Table of content


Requirements

  • Minimum Ansible version: 2.10

Default Variables

coredns_default_zones

List of default zone file definitions

Default value

coredns_default_zones: []

Example usage

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

coredns_download

URL to the archive of the release to install

Default value

coredns_download: https://github.com/coredns/coredns/releases/download/v{{ coredns_version
  }}/coredns_{{ coredns_version }}_linux_amd64.tgz

coredns_extra_zones

List of extra zone file definitions

Default value

coredns_extra_zones: []

Example usage

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

coredns_general_config

Optional raw config to overwrite the Corefile

Default value

coredns_general_config:

coredns_general_enabled

Enable the default zone part of core config

Default value

coredns_general_enabled: true

coredns_general_name

Zone for the general standard configuration

Default value

coredns_general_name: .

coredns_general_plugins

List of plugins for standard configuration

Default value

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

coredns_general_plugins:
  - name: errors
  - name: log
  - name: prometheus
  - name: chaos
    args: CoreDNS-001 [email protected]
  - name: cache
    args: 30
  - name: loop
  - name: loadbalance

coredns_listen_port

Override the port binding for CoreDNS

Default value

coredns_listen_port:

coredns_version

Version of the release to install

Default value

coredns_version: 1.11.4

Discovered Tags

coredns

Dependencies

  • None

License

Apache-2.0

Author

Thomas Boerger