From ec7f841a7c314a5baa646cc894c0c4de4ff0e921 Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Thu, 15 Jan 2015 18:07:41 -0500 Subject: [PATCH] Add restarting of supervisord and uwsgi app into handlers to allow for more dynamic reuse of role calls. --- handlers/main.yml | 8 ++++++++ tasks/supervisor.yaml | 1 + tasks/uwsgi.yaml | 4 ---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 32c38c8..441f519 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,2 +1,10 @@ --- # handlers file for ansible-nginx-uwsgi-supervisor +- name: restart uwsgi app + supervisorctl: name={{ uwsgi_service_name }} state=restarted config=/etc/supervisor/supervisor.conf + sudo: yes + +- name: restart supervisord + service: name=supervisor state=restarted + sudo: yes + diff --git a/tasks/supervisor.yaml b/tasks/supervisor.yaml index eb15b95..f511c2c 100644 --- a/tasks/supervisor.yaml +++ b/tasks/supervisor.yaml @@ -22,3 +22,4 @@ - name: upload supervisor configuration to web server home template: src=supervisor/app_supervisor.conf dest=/etc/supervisor/conf.d/{{ supervisor_app_config }} sudo: yes + notify: restart supervisord diff --git a/tasks/uwsgi.yaml b/tasks/uwsgi.yaml index 32e2a83..2381cb0 100644 --- a/tasks/uwsgi.yaml +++ b/tasks/uwsgi.yaml @@ -6,7 +6,3 @@ - name: configure app on uwsgi server template: src=uwsgi/app_uwsgi.ini dest={{ uwsgi_config }}/{{ uwsgi_app_ini }} sudo: yes - -- name: restart uwsgi server - supervisorctl: name=uwsgi state=restarted config=/etc/supervisor/supervisor.conf - sudo: yes