-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c4a18a
commit a5bb024
Showing
4 changed files
with
48 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
--- | ||
supervisord_unix_http_server_socket_file: "/var/run/supervisor.sock" | ||
supervisord_unix_http_server_socket_mode: "0700" | ||
supervisord_unix_http_server_socket_chown: "root:supervisord" | ||
supervisord_unix_http_server_socket_file: "/var/run/supervisor.sock" | ||
supervisord_unix_http_server_socket_mode: "0700" | ||
supervisord_unix_http_server_socket_chown: "root:supervisord" | ||
|
||
supervisord_logfile: "/var/log/supervisor/supervisord.log" | ||
supervisord_pidfile: "/var/run/supervisord.pid" | ||
supervisord_childlogdir: "/var/log/supervisor" | ||
supervisord_logfile: "/var/log/supervisor/supervisord.log" | ||
supervisord_pidfile: "/var/run/supervisord.pid" | ||
supervisord_childlogdir: "/var/log/supervisor" | ||
|
||
supervisord_supervisorctl_serverurl: "unix://{{ supervisord_unix_http_server_socket_file }}" | ||
supervisord_supervisorctl_serverurl: "unix://{{ supervisord_unix_http_server_socket_file }}" | ||
|
||
supervisord_include_path: "/etc/supervisor/conf.d" | ||
supervisord_include_files: "{{ supervisord_include_path }}/*.conf" | ||
|
||
supervisord_log_fatal_state_to_syslog: False | ||
supervisord_log_fatal_state_to_syslog: false | ||
|
||
python_package: "python" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
--- | ||
|
||
- name: Reload supervisord configuration | ||
command: supervisorctl reread | ||
ansible.builtin.command: "supervisorctl reread" | ||
notify: Apply supervisord changes | ||
changed_when: false | ||
tags: | ||
- skip_ansible_lint | ||
|
||
- name: Apply supervisord changes | ||
command: supervisorctl update | ||
ansible.builtin.command: "supervisorctl update" # noqa | ||
changed_when: false | ||
tags: | ||
- skip_ansible_lint | ||
|
||
- name: Restart supervisord | ||
ansible.builtin.service: | ||
name: supervisor | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,39 @@ | ||
--- | ||
|
||
- name: Install supervisord | ||
apt: pkg=supervisor state=present | ||
ansible.builtin.apt: | ||
pkg: supervisor | ||
state: present | ||
|
||
- name: Create supervisord group | ||
group: name=supervisord system=yes state=present | ||
ansible.builtin.group: | ||
name: supervisord | ||
system: "yes" | ||
state: present | ||
|
||
- name: Add the supervisor fatals events listener | ||
copy: src=files/supervisor-fatals-listener.py mode=755 dest=/usr/local/bin/supervisor-fatals-listener.py | ||
ansible.builtin.copy: | ||
src: files/supervisor-fatals-listener.py | ||
mode: "0755" | ||
dest: /usr/local/bin/supervisor-fatals-listener.py | ||
when: supervisord_log_fatal_state_to_syslog | ||
|
||
- name: Configure the supervisor fatals events listener | ||
template: | ||
ansible.builtin.template: | ||
src: "files/supervisor.event.listeners.conf.j2" | ||
dest: "/etc/supervisor/conf.d/eventlisteners.conf" | ||
mode: "0644" | ||
when: supervisord_log_fatal_state_to_syslog | ||
|
||
- name: Create supervisord config | ||
template: src=supervisord.conf.j2 dest=/etc/supervisor/supervisord.conf | ||
ansible.builtin.template: | ||
src: supervisord.conf.j2 | ||
dest: /etc/supervisor/supervisord.conf | ||
mode: "0644" | ||
register: supervisord_config_file | ||
|
||
- name: Restart supervisord if the config task has changes | ||
service: name=supervisor state=restarted | ||
when: supervisord_config_file.changed | ||
notify: Restart supervisord | ||
|
||
- name: Start supervisord | ||
service: name=supervisor state=started enabled=yes | ||
|
||
ansible.builtin.service: | ||
name: supervisor | ||
state: started | ||
enabled: "yes" |