瀏覽代碼

Be more efficient while reloading web servers (config check)

Emmanuel Bouthenot 8 年之前
父節點
當前提交
fd855bc3da
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      roles/webserver/handlers/apache2.yml
  2. 1 1
      roles/webserver/handlers/nginx.yml

+ 1 - 1
roles/webserver/handlers/apache2.yml

@@ -1,5 +1,5 @@
 - name: Reload apache2
-  service: name=apache2 state=reloaded
+  shell: apache2ctl configtest && apache2ctl graceful
 
 - name: Restart apache2
   service: name=apache2 state=restarted

+ 1 - 1
roles/webserver/handlers/nginx.yml

@@ -1,5 +1,5 @@
 - name: Reload nginx
-  service: name=nginx state=reloaded
+  shell: nginx -t && nginx -s reload
 
 - name: Restart nginx
   service: name=nginx state=restarted