From 60e357429e6f48606a56ccd67d169da8c32275cd Mon Sep 17 00:00:00 2001 From: Panos Katseas Date: Mon, 22 Feb 2016 14:15:35 +0000 Subject: [PATCH 1/3] Document no signalling support for Ubuntu 12.04 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5be0e88..649f2c8 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,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 From 47024746abe6c51e02b0415816dfca782a2eaec6 Mon Sep 17 00:00:00 2001 From: Panos Katseas Date: Mon, 22 Feb 2016 14:31:58 +0000 Subject: [PATCH 2/3] Add note for gathered facts --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 649f2c8..da9d7cc 100644 --- a/README.md +++ b/README.md @@ -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 From 793f69c1d948ab515aeeb355cac700d033cdaaa3 Mon Sep 17 00:00:00 2001 From: Panos Katseas Date: Mon, 22 Feb 2016 14:32:18 +0000 Subject: [PATCH 3/3] Ubuntu 12.04: always restart, don't signal Ubuntu 12.04 doesn't support signaling, we restart instead. Closes #8 --- tasks/main.yml | 6 +++--- vars/12.04.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 16db105..e7daffc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/vars/12.04.yml b/vars/12.04.yml index 1f1015a..7825302 100644 --- a/vars/12.04.yml +++ b/vars/12.04.yml @@ -1,2 +1,2 @@ supervisor_deb_file: "supervisor_3.0a8-1.1_all.deb" -supervisor_version: "3.0a8-1.1" \ No newline at end of file +supervisor_version: "3.0a8-1.1"