Browse Source

When updating zones, restart dns stack also on satellite machines

master
blallo 9 months ago
parent
commit
c059caa5a8
Signed by: blallo GPG Key ID: 0CBE577C9B72DC3F
  1. 35
      tasks/nsd_satellite.yml

35
tasks/nsd_satellite.yml

@ -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

Loading…
Cancel
Save