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

---
 tasks/main.yml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tasks/main.yml b/tasks/main.yml
index e932ebe..a8eb82f 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -35,10 +35,14 @@
       owner: root
       group: 0
       mode: 0o0644
-      validate: '{{ dhcp_conf_validate[ansible_os_family]|default(omit) }}'
   notify:
       - Restart ISC DHCP server
 
+- name: Validate config
+  when: ansible_os_family in dhcp_conf_validate
+  command: '{{ dhcp_conf_validate[ansible_os_family] }}'
+  changed_when: False
+
 - name: Enable service
   service:
       name: '{{ dhcp_service[ansible_os_family] }}'
-- 
GitLab