Skip to content

Commit

Permalink
Merge pull request #9 from EDITD/8-12.04
Browse files Browse the repository at this point in the history
8 12.04
  • Loading branch information
pkatseas committed Feb 25, 2016
2 parents 8bb8500 + 793f69c commit bbec033
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

A role for creating supervisor tasks.

**NOTE**: This role depends on facts being gathered and will fail when `gather_facts` is set to false/no.


## Actions

Expand Down Expand Up @@ -52,6 +54,10 @@ to gracefully restart their workers. An example of how to do that would be:
signal_task: HUP
```

Unfortunately versions 3.2.0+ of supervisor are not compatible with Ubuntu 12.04,
in which case an older supervisor version is installed instead, without signaling support.
In these systems tasks will always be restarted, even when `restart: no` is passed to the role.

## License

MIT
6 changes: 3 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@

- name: Restart task {{ name }}
command: "{{ supervisorctl_command }} restart {{ name }}:*"
when: restart_task
when: ansible_distribution_version == "12.04" or restart_task
sudo: yes

- name: Send signal to task {{ name }}
- name: Send {{ signal_task }} signal to task {{ name }}
command: "{{ supervisorctl_command }} signal {{ signal_task }} {{ name }}:*"
when: signal_task is defined
when: ansible_distribution_version != "12.04" and signal_task is defined
sudo: yes
2 changes: 1 addition & 1 deletion vars/12.04.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
supervisor_deb_file: "supervisor_3.0a8-1.1_all.deb"
supervisor_version: "3.0a8-1.1"
supervisor_version: "3.0a8-1.1"

0 comments on commit bbec033

Please sign in to comment.