From b74c1f889b996ae2c8aba209b65ff4e2705c1206 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sun, 25 Dec 2016 20:37:13 +0200
Subject: [PATCH] - Validate config as a task (Ansible's validate requires
 specifying the config file).

---
 tasks/main.yml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tasks/main.yml b/tasks/main.yml
index 25a2eab..b1e79a9 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -35,7 +35,6 @@
       owner: root
       group: 0
       mode: 0o0644
-      validate: 'nsd-checkconf {{ nsd_conf }}'
   notify:
       - Restart NSD
 
@@ -49,7 +48,6 @@
       owner: root
       group: 0
       mode: 0o644
-      validate: 'nsd-checkconf {{ nsd_conf }}'
   notify:
       - Restart NSD
 
@@ -63,6 +61,10 @@
   notify:
       - Update SMTPd database
 
+- name: Validate config
+  command: 'nsd-checkconf {{ nsd_conf }}'
+  changed_when: False
+
 - name: Enable NSD
   service:
       name: nsd
-- 
GitLab