Skip to content

Commit 6e0b983

Browse files
committed
Validate configuration files
1 parent 1efe2f3 commit 6e0b983

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tasks/deploy_netbox.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
owner: "{{ netbox_user }}"
4141
group: "{{ netbox_group }}"
4242
mode: 0640
43+
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)\""
4344
notify:
4445
- reload netbox.service
4546

@@ -58,6 +59,7 @@
5859
owner: "{{ netbox_user }}"
5960
group: "{{ netbox_group }}"
6061
mode: 0640
62+
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)\""
6163
notify:
6264
- reload netbox.service
6365
when:

0 commit comments

Comments
 (0)