When updating zones, restart dns stack also on satellite machines

This commit is contained in:
sfigato 2021-03-01 14:36:37 +01:00
parent 2e4466d8f3
commit c059caa5a8
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F

View File

@ -7,3 +7,38 @@
group: root
mode: 0600
notify: restart nsd
- name: Ensure zones src directory is present
file:
path: /etc/nsd/src_zones
state: directory
owner: root
group: root
mode: 0750
- name: Ensure main zone stub is present
template:
src: templates/zone_stub.conf.j2
dest: "/etc/nsd/src_zones/{{ main_zone.name }}.conf"
owner: root
group: root
mode: 0640
vars:
name: "{{ main_zone.name }}"
mx_records: "{{ main_zone.records|json_query('[?type==`MX`]') }}"
records: "{{ main_zone.records|json_query('[?type!=`MX`]') }}"
notify: restart dns
- name: Ensure zones stubs are present
template:
src: templates/zone_stub.conf.j2
dest: "/etc/nsd/src_zones/{{ item.name }}.conf"
owner: root
group: root
mode: 0640
vars:
name: "{{ item.name }}"
mx_records: "{{ item.records|json_query('[?type==`MX`]') }}"
records: "{{ item.records|json_query('[?type!=`MX`]') }}"
loop: "{{ zones }}"
notify: restart dns