Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix restart handler failing randomly (fix #47). #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
# handlers file for supervisor
---
- name: restart supervisor

# https://github.com/Oefenweb/ansible-supervisor/issues/47
- name: stop supervisor
service:
name: supervisor
state: restarted
when: service_default_state | default('started') == 'started'
state: stopped
listen: "restart supervisor"

- name: waiting for supervisor to be stopped
wait_for:
path: /var/run/supervisord.pid
state: absent
sleep: 5
listen: "restart supervisor"

- shell: ps faux | grep supervisor

- name: start supervisor
service:
name: supervisor
state: started
listen: "restart supervisor"