add syntax check
authorBernhard Tittelbach <bernhard@tittelbach.org>
Tue, 11 Nov 2025 16:36:08 +0000 (17:36 +0100)
committerBernhard Tittelbach <bernhard@tittelbach.org>
Tue, 11 Nov 2025 16:36:08 +0000 (17:36 +0100)
ansible/roles/web/r3redirects/tasks/nginx.yml

index 0708778..552bea2 100644 (file)
         state: link
       with_items: "{{ acmecert_missing_hostnames }}"
 
+- name: syntax check nginx config before enabling vhost
+  command: nginx -t
+  register: nginx_syntax_check
+  failed_when: nginx_syntax_check.rc != 0
+  changed_when: false
+
 - name: enable vhost config using acme cert
   file:
     src: "../sites-available/{{ r3rsrv.name }}"