manala.bind
#######################################################################################################
:exclamation: DEPRECATION :exclamation:
This repository and its associated role are no longer maintained. Please use the Manala Ansible Collection instead.
For usage information, visit the collection repository.
#######################################################################################################
Ansible Role: Bind 
:exclamation: Please report issues and submit Pull Requests in the main Ansible Role repository :exclamation:
This role is designed to set up Bind.
It is part of the Manala Ansible stack but can be used individually.
Requirements
No special requirements.
Dependencies
No dependencies.
Installation
For Ansible 2+
To install using the Ansible Galaxy command line:
ansible-galaxy install manala.bind
To install using an Ansible Galaxy requirements file:
- src: manala.bind
Role Filters
| Name | Description |
|---|---|
manala_bind_zone_file |
Standardizes zone file names |
Role Variables
| Name | Default | Type | Description |
|---|---|---|---|
manala_bind_install_packages |
~ | Array | Packages to install |
manala_bind_install_packages_default |
['bind9'] | Array | Default packages to install |
manala_bind_user |
'bind' | String | User |
manala_bind_group |
'bind' | String | Group |
manala_bind_options |
['-u {{ manala_bind_user }}'] | Array | Options |
manala_bind_log_dir |
'/var/log/bind' | String | Directory for logs |
manala_bind_configs |
[] | Array | List of configuration files |
manala_bind_configs_dir |
'/etc/bind' | String | Directory for config files |
manala_bind_zones_dir |
'/var/cache/bind' | String | Directory for zone files |
manala_bind_zones |
[] | Array | List of zone files |
Configuration Example
Options
See: https://linux.die.net/man/8/named
manala_bind_options:
- -u {{ manala_bind_user }}
- -4 # Only use IPv4
Configs
The file path is relative to the manala_bind_configs_dir parameter.
Config contents can be specified as a Jinja2 template or as raw content.
Each config entry can also have a state (present|absent) and an omit (false|true) parameter.
manala_bind_configs:
- file: named.conf.options
template: bind/configs/named.conf.options.j2
- file: named.conf.local
content: |
// Consider adding 1918 zones here if not used in your organization.
include "{{ manala_bind_configs_dir }}/zones.rfc1918";
- file: named.conf.foo
state: absent
- file: named.conf.bar
omit: true
Zones - Static
You must specify either zone or file. If neither is provided, file will be based on zone.
The file path is relative to manala_bind_zones_dir.
Config contents can be specified as a Jinja2 template or as raw content.
Each config entry can also have a state (present|absent) and an omit (false|true) parameter.
manala_bind_zones:
- zone: foo.local
template: bind/zones/db.foo.local.j2
- zone: bar.local
content: |
@ IN SOA ns.bar.local. contact.bar.local. (
1 ; serial
604800 ; refresh (1 week)
86400 ; retry (1 day)
2419200 ; expire (4 weeks)
86400 ; minimum (1 day)
)
@ IN NS ns.bar.local.
ns IN A 172.16.1.1";
- zone: baz.local
state: absent
- zone: qux.local
omit: true
Zones - Dynamic
You must specify zone and set dynamic to true.
The zone configuration must allow updates from localhost at least.
Due to the dynamic nature, content or template parameters are only considered if the file does not already exist.
manala_bind_configs:
- file: named.conf.local
content: |
zone "foo.local" {
type master;
file "{{ 'foo.local'|manala_bind_zone_file }}";
allow-update { localhost; };
};
manala_bind_zones:
- zone: foo.local
dynamic: true
content: |
@ IN SOA ns.foo.local. contact.foo.local. (
1 ; serial
604800 ; refresh (1 week)
86400 ; retry (1 day)
2419200 ; expire (4 weeks)
86400 ; minimum (1 day)
)
@ IN NS ns.foo.local.
ns IN A 172.16.1.1";
records:
- { record: bar, value: 172.16.1.123 }
Example Playbook
- hosts: servers
roles:
- { role: manala.bind }
License
MIT
Author Information
Manala (http://www.manala.io/)
ansible-galaxy install manala.bind