Skip to content

Commit bcc81f9

Browse files
authored
Merge pull request #44 from Oefenweb/autorestart-default-value-as-unexpected
autorestart default value as unexpected
2 parents 5f3a81c + d9ebe73 commit bcc81f9

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ python: "2.7"
77

88
env:
99
- ANSIBLE_VERSION=latest
10+
- ANSIBLE_VERSION=2.5.1
1011
- ANSIBLE_VERSION=2.5.0
1112
- ANSIBLE_VERSION=2.4.4.0
1213
- ANSIBLE_VERSION=2.4.3.0

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ Set up the latest or a specific version of supervisor in Debian-like systems.
4040
* `supervisor_programs_present.{n}.command` [required]: The command that will be run when this program is started
4141
* `supervisor_programs_present.{n}.directory` [optional]: A directory to which supervisord should temporarily chdir before exec’ing the child
4242
* `supervisor_programs_present.{n}.environment` [optional]: A list of key/value pairs comma separated that will be placed in the child process’ environment (e.g. 'KEY1="VALUE1",KEY2="VALUE2"')
43-
* `supervisor_programs_present.{n}.autostart` [optional]: If true, this program will start automatically when supervisord is started
44-
* `supervisor_programs_present.{n}.autorestart` [optional]: Whether the process will be autorestarted
43+
* `supervisor_programs_present.{n}.autostart` [optional, default `true`]: If true, this program will start automatically when supervisord is started
44+
* `supervisor_programs_present.{n}.autorestart` [optional, default `unexpected`]: Whether the process will be autorestarted (e.g. `true`, `false`)
4545
* `supervisor_programs_present.{n}.startretries` [optional]: The number of serial failure attempts that supervisord will allow when attempting to start the program before giving up
4646
* `supervisor_programs_present.{n}.startsecs` [optional]: The total number of seconds which the program needs to stay running after a startup to consider the start successful
4747
* `supervisor_programs_present.{n}.stdout_logfile` [optional]: Put process stdout output in this file
@@ -53,8 +53,8 @@ Set up the latest or a specific version of supervisor in Debian-like systems.
5353
* `supervisor_programs_present.{n}.process_name` [optional]: Process name, defaults to `%(program_name)s-%(process_num)s` when `numprocs` > 1
5454
* `supervisor_programs_present.{n}.stopsignal` [optional]: The signal used to kill the program when a stop is requested
5555
* `supervisor_programs_present.{n}.stopwaitsecs` [optional]: The number of seconds to wait for the OS to return a `SIGCHILD` to supervisord after the program has been sent a stopsignal
56-
* `supervisor_programs_present.{n}.stopasgroup` [optional]: If `true`, the flag causes supervisor to send the stop signal to the whole process group and implies `killasgroup` is `true`
57-
* `supervisor_programs_present.{n}.killasgroup` [optional]: If `true`, when resorting to send `SIGKILL` to the program to terminate it send it to its whole process group instead, taking care of its children as well
56+
* `supervisor_programs_present.{n}.stopasgroup` [optional, default `false`]: If `true`, the flag causes supervisor to send the stop signal to the whole process group and implies `killasgroup` is `true`
57+
* `supervisor_programs_present.{n}.killasgroup` [optional, default `false`]: If `true`, when resorting to send `SIGKILL` to the program to terminate it send it to its whole process group instead, taking care of its children as well
5858
* `supervisor_programs_absent` [default: `{}`]: Program definitions (to be removed)
5959

6060
* `supervisor_groups_present` [default: `{}`, see `templates/etc/supervisor/conf.d/group.conf.j2`]: Group definitions

Vagrantfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ boxes = [
3939
:cpu => "50",
4040
:ram => "256"
4141
},
42+
{
43+
:name => "debian-9",
44+
:box => "bento/debian-9",
45+
:ip => '10.0.0.16',
46+
:cpu => "50",
47+
:ram => "256"
48+
},
4249
]
4350

4451
Vagrant.configure("2") do |config|

meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ galaxy_info:
1616
versions:
1717
- wheezy
1818
- jessie
19+
- stretch
1920
galaxy_tags:
2021
- web
2122
- system

templates/etc/supervisor/conf.d/program.conf.j2

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ directory={{ item.value.directory }}
99
environment={{ item.value.environment }}
1010
{% endif %}
1111
{% if item.value.autostart is defined %}
12-
autostart={{ item.value.autostart | default(false) | bool | to_json }}
12+
autostart={{ item.value.autostart | bool | to_json }}
1313
{% endif %}
1414
{% if item.value.autorestart is defined %}
15-
autorestart={{ item.value.autorestart | default(false) | bool | to_json}}
15+
autorestart={{ item.value.autorestart | to_json}}
1616
{% endif %}
1717
{% if item.value.startretries is defined %}
1818
startretries={{ item.value.startretries }}
@@ -50,8 +50,8 @@ stopsignal={{ item.value.stopsignal }}
5050
stopwaitsecs={{ item.value.stopwaitsecs }}
5151
{% endif %}
5252
{% if item.value.stopasgroup is defined %}
53-
stopasgroup={{ item.value.stopasgroup | default(false) | bool | to_json }}
53+
stopasgroup={{ item.value.stopasgroup | bool | to_json }}
5454
{% endif %}
5555
{% if item.value.killasgroup is defined %}
56-
killasgroup={{ item.value.killasgroup | default(false) | bool | to_json }}
56+
killasgroup={{ item.value.killasgroup | bool | to_json }}
5757
{% endif %}

0 commit comments

Comments
 (0)