From 6e0b9834dfe2ac28d70eabdf3faa3563b87aa417 Mon Sep 17 00:00:00 2001 From: Musee Ullah Date: Tue, 29 May 2018 10:07:08 -0700 Subject: [PATCH] Validate configuration files --- tasks/deploy_netbox.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/deploy_netbox.yml b/tasks/deploy_netbox.yml index cdba1b8..d7a4292 100644 --- a/tasks/deploy_netbox.yml +++ b/tasks/deploy_netbox.yml @@ -40,6 +40,7 @@ owner: "{{ netbox_user }}" group: "{{ netbox_group }}" mode: 0640 + validate: "{{ netbox_virtualenv_path }}/bin/python -c \"import py_compile,os; f=r'%s'; c='/tmp/' + os.path.basename(os.path.dirname(f)) + '-' + os.path.basename(f) + 'c'; py_compile.compile(f, c); os.remove(c)\"" notify: - reload netbox.service @@ -58,6 +59,7 @@ owner: "{{ netbox_user }}" group: "{{ netbox_group }}" mode: 0640 + validate: "{{ netbox_virtualenv_path }}/bin/python -c \"import py_compile,os; f=r'%s'; c='/tmp/' + os.path.basename(os.path.dirname(f)) + '-' + os.path.basename(f) + 'c'; py_compile.compile(f, c); os.remove(c)\"" notify: - reload netbox.service when: