Skip to content

Commit 9b52e2d

Browse files
committed
Fixes #43: Fix confusing use of supervisor_version.
1 parent cdc8079 commit 9b52e2d

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Python `pip` should be installed. If it is not already installed, you can use th
1212

1313
Available variables are listed below, along with default values (see `defaults/main.yml`):
1414

15-
supervisor_version: latest
15+
supervisor_version: ''
1616

17-
Install a specific version of Supervisor by setting it here. See [available Supervisor versions](https://pypi.python.org/pypi/supervisor) on Pypi. `latest` installs the latest stable release.
17+
Install a specific version of Supervisor by setting it here. See [available Supervisor versions](https://pypi.python.org/pypi/supervisor) on Pypi. If no version is set, it will install the latest stable version of Supervisor when the role is run.
1818

1919
supervisor_started: true
2020
supervisor_enabled: true

defaults/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# Install a specific version of Supervisor by setting it here (e.g. '3.3.1').
3-
supervisor_version: latest
3+
supervisor_version: ''
44

55
# Choose whether to use an init script or systemd unit configuration to start
66
# Supervisor when it's installed and/or after a system boot.

tasks/main.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,11 @@
22
- name: Include OS-specific variables.
33
include_vars: "{{ ansible_os_family }}.yml"
44

5-
- name: Ensure Supervisor is installed (specific version).
5+
- name: Ensure Supervisor is installed.
66
pip:
77
name: supervisor
88
state: present
9-
version: "{{ supervisor_version }}"
10-
when: supervisor_version != 'latest'
11-
12-
- name: Ensure Supervisor is installed (latest version).
13-
pip:
14-
name: supervisor
15-
state: present
16-
when: supervisor_version == 'latest'
9+
version: "{{ supervisor_version | default(omit) }}"
1710

1811
- name: Ensure Supervisor log dir exists.
1912
file:

0 commit comments

Comments
 (0)