Skip to content

Commit

Permalink
Fix reload of nginx & monit
Browse files Browse the repository at this point in the history
  • Loading branch information
HashNuke committed Jul 17, 2015
1 parent d84aebc commit 06790c1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
12 changes: 1 addition & 11 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
---
- name: restart nginx
monit: name=nginx state=restarted

- name: reload nginx
monit: name=nginx state=reloaded

- name: reload monit
service: name=monit state=reloaded

- name: restart monit
service: name=monit state=restarted
# No handlers yet
12 changes: 8 additions & 4 deletions tasks/action-remove-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
- "/etc/nginx/sites-available/{{ app_name }}.nginx"
- "/etc/nginx/sites-enabled/{{ app_name }}.nginx"
ignore_errors: True
notify:
- reload nginx


- name: reload nginx
command: "nginx -s reload"


- name: remove monit config for app
file: path="/etc/monit/conf.d/{{ app_name }}.monit" state=absent
ignore_errors: True
notify:
- reload monit


- name: reload monit
service: name=monit state=reloaded
6 changes: 5 additions & 1 deletion tasks/action-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@


- name: start nginx using monit
monit: name="nginx" state=restarted
monit: name="nginx" state=started


- name: reload nginx config
service: name=nginx state=reloaded
9 changes: 3 additions & 6 deletions tasks/monit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,18 @@

- name: start monit & mark to be started on system reboots
service: name=monit state=started enabled=yes
notify:
- restart monit


- name: add monit config for elixir app
template:
src: app.monit.j2
dest: "/etc/monit/conf.d/{{ app_name }}.monit"
notify:
- reload monit


- name: add monit config for nginx
template:
src: nginx.monit.j2
dest: "/etc/monit/conf.d/nginx.monit"
notify:
- reload monit

- name: reload monit
service: name=monit state=reloaded

0 comments on commit 06790c1

Please sign in to comment.