Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

check configuration files and some new options #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
14 changes: 10 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,21 @@
tags: configuration

- name: configure bind
copy: src=named.conf dest={{ bind_config_basepath }}/named.conf owner={{ bind_user }} group={{ bind_group }} mode=0600 validate='named-checkconf %s'
notify: restart bind
copy: src=named.conf dest={{ bind_config_basepath }}/named.conf owner={{ bind_user }} group={{ bind_group }} mode=0600
tags: configuration

- name: configure bind options
template: src=named.conf.options.j2 dest={{ bind_config_basepath }}/named.conf.options owner={{ bind_user }} group={{ bind_group }} mode=0600 validate='named-checkconf %s'
notify: restart bind
template: src=named.conf.options.j2 dest={{ bind_config_basepath }}/named.conf.options owner={{ bind_user }} group={{ bind_group }} mode=0600
tags: configuration

- name: check files
command: named-checkconf "{{ bind_config_basepath }}/{{ item}}"
with_items:
- named.conf
- named.conf.options
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 }}
with_items: bind_config_master_zones
Expand Down
23 changes: 23 additions & 0 deletions templates/named.conf.local.master.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
zone "{{ master_zone.name }}" {
type master;
file "{{bind_base_zones_path}}/{{bind_masterzones_path}}/db.{{ master_zone.name }}";
{% if master_zone.allow_query is defined %}
allow-query {
{% for allow_query in master_zone.allow_query %}
{{ allow_query }};
{% endfor %}
};
{% endif %}
{% if master_zone.allow_transfer is defined %}
allow-transfer {
{% for allow_transfer in master_zone.allow_transfer %}
Expand All @@ -18,6 +25,22 @@ zone "{{ master_zone.name }}" {
{% endfor %}
};
{% endif %}

{% if master_zone.slave is defined or bind_config_master_allow_transfer is defined %}
notify explicit;
also-notify {
{% if bind_config_master_allow_transfer is defined %}
{% for notify_update in bind_config_master_allow_transfer %}
{{ notify_update }};
{% endfor %}
{% endif %}
{% if master_zone.slave is defined %}
{% for notify_update in master_zone.slave %}
{{ notify_update }};
{% endfor %}
{% endif %}
};
{% endif %}
};

{% endfor %}
16 changes: 10 additions & 6 deletions templates/named.conf.options.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ options {
{% endfor %}
};

notify yes;

also-notify {
};

//provide-ixfr no ;

{% if bind_config_master_forwarders %}
Expand All @@ -49,6 +44,15 @@ options {
listen-on-v6 { any; };

allow-query { any; }; // This is the default
recursion {{ bind_config_recursion }}; // Do not provide recursive service

{% if bind_config_recursion %}
// If you want to limit whose can use the recursion method.

allow-recursion {
{% for network in bind_config_recursion %}
{{ network }};
{% endfor %}
};
{% endif %}
zone-statistics yes;
};