karlmdavis.bind-dns
Ansible Role for BIND DNS
This role is for setting up and managing BIND, which is a DNS server. Unlike other BIND roles for Ansible, this one uses Jinja templates for the zone database files instead of just copying files without changes. This feature is especially helpful for testing.
Requirements
This role works with Ansible version 2.4.0.0 and above and requires Ubuntu Server 14.04 or 16.04 on the systems where it will be used.
Role Variables
You can customize this role by changing the variables below. Check defaults/main.yml for the default values.
The main variable is the zones list. It outlines the zones served by BIND and the source template files used to create the zone database files.
zones:
- {name: 'example.com', template_source: 'templates/db.example.com.j2'}
- {name: 'example.net', template_source: 'templates/db.example.net.j2'}
The forwarders variable lists which servers will help resolve queries that this server is not responsible for.
forwarders:
- 192.0.2.1
- 203.0.113.1
The zone_transfer_peers variable indicates which other DNS servers can perform zone transfers from this server. Include any secondary name servers for the domains listed.
zone_transfer_peers:
- 192.0.2.2
- 203.0.113.2
Dependencies
This role does not depend on other Ansible roles.
Example Playbook
You can include this role like this:
- hosts: somebox
tasks:
- import_role:
name: karlmdavis.bind-dns
vars:
zones:
- {name: 'example.com', template_source: 'templates/db.example.com.j2'}
forwarders:
- 192.0.2.1
- 203.0.113.1
zone_transfer_peers:
- 192.0.2.2
- 203.0.113.2
License
Author Information
This role was created by Karl M. Davis (https://justdavis.com/karl/).
This role can be used to install and manage BIND, a DNS server.
ansible-galaxy install karlmdavis.bind-dns