commit eb6b46e1633e3c3c1a4e73072d65e52d46db1e95
parent bc8fb8338522fc2585df3bc515c1c6e6603ab455
Author: Leah Thein <leah@toaster.fritz.box>
Date: Sat, 5 Dec 2020 13:39:23 +0100
parent bc8fb8338522fc2585df3bc515c1c6e6603ab455
Author: Leah Thein <leah@toaster.fritz.box>
Date: Sat, 5 Dec 2020 13:39:23 +0100
bind: only master dns servers
2 files changed, 6 insertions(+), 39 deletions(-)
diff --git a/roles/bind/tasks/main.yml b/roles/bind/tasks/main.yml @@ -10,8 +10,6 @@ git: repo: 'https://cgit.ctu.cx/dns-zones' dest: /var/lib/named/zones - when: bind.type == "master" - - name: change ownership of /var/lib/named file: @@ -20,19 +18,6 @@ group: named state: directory recurse: yes - when: bind.type == "master" - -- name: clear zonedata to pull it again - file: - state: "{{ item }}" - path: /var/lib/named - owner: named - group: named - mode: 0755 - with_items: - - absent - - directory - when: bind.type == "slave" - name: copy named.conf to destination host template:
diff --git a/roles/bind/templates/named.conf.j2 b/roles/bind/templates/named.conf.j2 @@ -1,32 +1,13 @@ options { directory "/var/lib/named"; - notify yes; -{% if bind.type == "master" %} - allow-transfer { -{% for slave in bind.slaves %} - {{ slave }}; -{% endfor %} - }; -{% endif %} -}; - +}; -{% for domain in bind.domains %} +{% for domain in service.bind.domains %} zone "{{ domain }}" in { - type {{ bind.type }}; -{% if bind.type == "master" %} + type master; file "/var/lib/named/zones/{{ domain }}.zone"; -{% else %} - file "/var/lib/named/{{ domain }}.zone"; -{% endif %} - -{% if bind.type == "slave" %} - masters { -{% for master in bind.masters %} - {{ master }}; -{% endfor %} - }; -{% endif %} }; {% endfor %} + +controls { };+ \ No newline at end of file