Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

# Ansible Bind Role

An ansible role for installing and managing bind, acting as primary and/or secondary nameserver.
It does also copy the master zone files (`bind_masterzones_path`), but however, the zone files must exist.
An ansible role for installing and managing bind, acting as primary and/or secondary nameserver.
It does also copy the master zone files (`bind_masterzones_path`), but however, the zone files must exist in the local machine (`bind_masterzones_local_path`).


## Configuration:

Define where your zones files are stored:
Define where your zones files are stored in the server:

bind_masterzones_path: path/to/zones_dir

Define where your zones files are stored in the ansible controller machine:

bind_masterzones_local_path: path/to/zones/local/dir/

Configure the domains of the zones for a bind act as primary nameserver:

bind_config_master_zones:
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ bind_service_enabled: yes
bind_pkg_state: installed
bind_base_zones_path: "/var/lib/bind"
bind_masterzones_path: "masters"
bind_masterzones_local_path: "masters"
bind_slavezones_path: "slaves"
bind_config_listen_on: any
bind_config_allow_query: []
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
notify: restart bind

- name: Copy master zone files
copy: src={{ bind_masterzones_path }}/db.{{ item.name }} dest={{ bind_base_zones_path }}/{{bind_masterzones_path}} owner={{ bind_user }} group={{ bind_group }}
copy: src={{ bind_masterzones_local_path }}/db.{{ item.name }} dest={{ bind_base_zones_path }}/{{bind_masterzones_path}} owner={{ bind_user }} group={{ bind_group }}
with_items: "{{ bind_config_master_zones }}"
notify: reload bind
tags: bind-zones
Expand Down