[bind-authoritative] Deploy zone file on slaves

certbot_on_virtu
_benjamin 2020-01-25 11:36:08 +01:00
parent 30cd13c791
commit d7d32e7b90
3 changed files with 35 additions and 0 deletions

View File

@ -22,6 +22,14 @@
# Deplay authoritative DNS server
- hosts: sputnik.adm.crans.org
vars:
bind:
master: false
master_ip: 10.231.136.118
zones:
- crans.org
- crans.eu
- crans.fr
roles:
- bind-authoritative

View File

@ -6,3 +6,16 @@
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Deploy Bind9 configuration
template:
src: bind/named.conf.local
dest: /etc/bind/named.conf.local
mode: 0644
owner: root
group: bind
- name: Reload Bind9
systemd:
name: bind9
state: reloaded

View File

@ -0,0 +1,14 @@
# {{ ansible_managed }}
{% if not bind.master %}
{% for zone in bind.zones %}
zone "{{ zone }}" {
type slave;
masters { {{ bind.master_ip }}; };
file "bak.{{ zone }}";
allow-transfer { "none"; };
notify no;
};
{% endfor %}
{% endif %}