فهرست منبع

Ensuring all instances that notify 'restart nginx' also validate first

cmacrae 9 سال پیش
والد
کامیت
a248416a4d
2فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 3 1
      tasks/main.yml
  2. 3 1
      tasks/vhosts.yml

+ 3 - 1
tasks/main.yml

@@ -27,7 +27,9 @@
     group: root
     mode: 0644
     validate: 'nginx -t -c %s'
-  notify: restart nginx
+  notify:
+    - validate nginx configuration
+    - restart nginx
 
 - name: Ensure nginx is started and enabled to start at boot.
   service: name=nginx state=started enabled=yes

+ 3 - 1
tasks/vhosts.yml

@@ -4,7 +4,9 @@
     path: "{{ nginx_default_vhost_path }}"
     state: absent
   when: nginx_remove_default_vhost
-  notify: restart nginx
+  notify:
+    - validate nginx configuration
+    - restart nginx
 
 - name: Add managed vhost config file (if any vhosts are configured).
   template: