Skip to content

autorestart default value as unexpected #44

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

Merged
merged 2 commits into from
Apr 20, 2018
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ python: "2.7"

env:
- ANSIBLE_VERSION=latest
- ANSIBLE_VERSION=2.5.1
- ANSIBLE_VERSION=2.5.0
- ANSIBLE_VERSION=2.4.4.0
- ANSIBLE_VERSION=2.4.3.0
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Set up the latest or a specific version of supervisor in Debian-like systems.
* `supervisor_programs_present.{n}.command` [required]: The command that will be run when this program is started
* `supervisor_programs_present.{n}.directory` [optional]: A directory to which supervisord should temporarily chdir before exec’ing the child
* `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"')
* `supervisor_programs_present.{n}.autostart` [optional]: If true, this program will start automatically when supervisord is started
* `supervisor_programs_present.{n}.autorestart` [optional]: Whether the process will be autorestarted
* `supervisor_programs_present.{n}.autostart` [optional, default `true`]: If true, this program will start automatically when supervisord is started
* `supervisor_programs_present.{n}.autorestart` [optional, default `unexpected`]: Whether the process will be autorestarted (e.g. `true`, `false`)
* `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
* `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
* `supervisor_programs_present.{n}.stdout_logfile` [optional]: Put process stdout output in this file
Expand All @@ -53,8 +53,8 @@ Set up the latest or a specific version of supervisor in Debian-like systems.
* `supervisor_programs_present.{n}.process_name` [optional]: Process name, defaults to `%(program_name)s-%(process_num)s` when `numprocs` > 1
* `supervisor_programs_present.{n}.stopsignal` [optional]: The signal used to kill the program when a stop is requested
* `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
* `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`
* `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
* `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`
* `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
* `supervisor_programs_absent` [default: `{}`]: Program definitions (to be removed)

* `supervisor_groups_present` [default: `{}`, see `templates/etc/supervisor/conf.d/group.conf.j2`]: Group definitions
Expand Down
7 changes: 7 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ boxes = [
:cpu => "50",
:ram => "256"
},
{
:name => "debian-9",
:box => "bento/debian-9",
:ip => '10.0.0.16',
:cpu => "50",
:ram => "256"
},
]

Vagrant.configure("2") do |config|
Expand Down
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ galaxy_info:
versions:
- wheezy
- jessie
- stretch
galaxy_tags:
- web
- system
Expand Down
8 changes: 4 additions & 4 deletions templates/etc/supervisor/conf.d/program.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ directory={{ item.value.directory }}
environment={{ item.value.environment }}
{% endif %}
{% if item.value.autostart is defined %}
autostart={{ item.value.autostart | default(false) | bool | to_json }}
autostart={{ item.value.autostart | bool | to_json }}
{% endif %}
{% if item.value.autorestart is defined %}
autorestart={{ item.value.autorestart | default(false) | bool | to_json}}
autorestart={{ item.value.autorestart | to_json}}
{% endif %}
{% if item.value.startretries is defined %}
startretries={{ item.value.startretries }}
Expand Down Expand Up @@ -50,8 +50,8 @@ stopsignal={{ item.value.stopsignal }}
stopwaitsecs={{ item.value.stopwaitsecs }}
{% endif %}
{% if item.value.stopasgroup is defined %}
stopasgroup={{ item.value.stopasgroup | default(false) | bool | to_json }}
stopasgroup={{ item.value.stopasgroup | bool | to_json }}
{% endif %}
{% if item.value.killasgroup is defined %}
killasgroup={{ item.value.killasgroup | default(false) | bool | to_json }}
killasgroup={{ item.value.killasgroup | bool | to_json }}
{% endif %}