From 2ae5fd8b3899f2ef6ee9bcb1a97021b326cf5f74 Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Mon, 28 Mar 2016 12:49:04 +0200 Subject: [PATCH] NSD: Validate configuration syntax using nsd-checkconf before applying --- tasks/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index ba51f51..d758710 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,17 +11,17 @@ file: path="{{ secondary_zones_dir }}" state=directory owner=nsd group=nsd mode=0755 -- name: Create base nsd3 configuration file - template: src=config.j2 dest="{{ nsd_config_dir }}/nsd.conf" owner=root group=root mode=0644 - notify: - - restart nsd3 - - name: Configure nsd3 zones - template: src=zones_config.j2 dest="{{ zones_config_file }}" owner=root group=root mode=0644 + template: src=zones_config.j2 dest="{{ zones_config_file }}" owner=root group=root mode=0644 validate='nsd-checkconf %s' notify: - rebuild nsd3 database - reload nsd3 database +- name: Create base nsd3 configuration file + template: src=config.j2 dest="{{ nsd_config_dir }}/nsd.conf" owner=root group=root mode=0644 validate='nsd-checkconf %s' + notify: + - restart nsd3 + - name: Copy content of primary zones copy: src="files/nsd/{{ item.zone_filename }}" dest="{{ primary_zones_dir }}/{{ item.zone_filename }}" owner=root group=root mode=0644