Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
e427e7c4
Commit
e427e7c4
authored
Jul 29, 2016
by
Max Rothman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OPS-1648: Write presupervisor/supervisor systemd config
parent
129328fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
2 deletions
+98
-2
playbooks/roles/supervisor/defaults/main.yml
+33
-0
playbooks/roles/supervisor/tasks/main.yml
+26
-2
playbooks/roles/supervisor/templates/etc/init/supervisor-systemd.service.j2
+39
-0
No files found.
playbooks/roles/supervisor/defaults/main.yml
View file @
e427e7c4
...
...
@@ -46,3 +46,36 @@ supervisor_version: 3.2.3
supervisor_pip_pkgs
:
-
boto=="{{ common_boto_version }}"
-
python-simple-hipchat
supervisor_spec
:
-
service
:
edxapp
python
:
python.edxapp
code
:
"
{{
edxapp_code_dir
|
default(None)
}}"
env
:
"
{{
edxapp_app_dir
|
default(None)
}}/edxapp_env"
-
service
:
xqueue
python
:
python.xqueue
code
:
"
{{
xqueue_code_dir
|
default(None)
}}"
-
service
:
ecommerce
python
:
python.ecommerce
code
:
"
{{
ecommerce_code_dir
|
default(None)
}}"
env
:
"
{{
ecommerce_home
|
default(None)
}}/ecommerce_env"
-
service
:
insights
python
:
python.insights
code
:
"
{{
insights_code_dir
|
default(None)
}}"
env
:
"
{{
insights_home
|
default(None)
}}/insights_env"
-
service
:
analytics_api
python
:
python.analytics_api
code
:
"
{{
analytics_api_code_dir
|
default(None)
}}"
env
:
"
{{
analytics_api_home
|
default(None)
}}/analytics_api_env"
-
service
:
programs
python
:
python.programs
code
:
"
{{
programs_code_dir
|
default(None)
}}"
env
:
"
{{
programs_home
|
default(None)
}}/programs_env"
-
service
:
credentials
python
:
python.credentials
code
:
"
{{
credentials_code_dir
|
default(None)
}}"
env
:
"
{{
credentials_home
|
default(None)
}}/credentials_env"
-
service
:
discovery
python
:
python.discovery
code
:
"
{{
discovery_code_dir
|
default(None)
}}"
env
:
"
{{
discovery_home
|
default(None)
}}/discovery_env"
playbooks/roles/supervisor/tasks/main.yml
View file @
e427e7c4
...
...
@@ -61,7 +61,7 @@
tags
:
-
install
-
install:base
-
name
:
Create supervisor and service user accessible directories
file
:
path
:
"
{{
item
}}"
...
...
@@ -121,6 +121,19 @@
dest
:
"
/etc/init/{{
supervisor_service
}}.conf"
owner
:
root
group
:
root
when
:
ansible_distribution_major_version < 16
tags
:
-
install
-
install:base
# NB: with systemd, pre_supervisor is a pre-task for supervisor, not a separate service
-
name
:
Create supervisor systemd job
template
:
src
:
"
etc/init/supervisor-systemd.service.j2"
dest
:
"
/etc/systemd/system/{{
supervisor_service
}}.service"
owner
:
root
group
:
root
when
:
ansible_distribution_major_version >= 16
tags
:
-
install
-
install:base
...
...
@@ -134,7 +147,9 @@
dest
:
"
/etc/init/pre_supervisor.conf"
owner
:
root
group
:
root
when
:
supervisor_service == "supervisor" and disable_edx_services and not devstack
when
:
>
supervisor_service == "supervisor" and disable_edx_services and not devstack
and ansible_distribution_major_version < 16
tags
:
-
to-remove
-
aws-specfic
...
...
@@ -198,6 +213,15 @@
-
install
-
install:configuration
-
name
:
Enable supervisor to start on boot
service
:
name
:
"
{{
supervisor_service
}}.service"
enabled
:
yes
when
:
ansible_distribution_major_version >= 16
tags
:
-
install
-
install:base
-
name
:
Start supervisor
service
:
name
:
"
{{
supervisor_service
}}"
...
...
playbooks/roles/supervisor/templates/etc/init/supervisor-systemd.service.j2
0 → 100644
View file @
e427e7c4
[Unit]
Description=supervisord - Supervisor process control system
Documentation=http://supervisord.org
After=network.target
[Service]
{% if disable_edx_services and not devstack -%}
# Run pre_supervisor
ExecStartPre={{ supervisor_venv_dir }}/bin/python {{ supervisor_app_dir }}/pre_supervisor_checks.py \
{% if SUPERVISOR_HIPCHAT_API_KEY is defined -%}
--hipchat-api-key {{ SUPERVISOR_HIPCHAT_API_KEY }} --hipchat-room {{ SUPERVISOR_HIPCHAT_ROOM }} \
{% endif -%}
{%- for item in supervisor_spec -%}
{%- if item.code -%}
{%- set name = item.service.replace('_', '-') -%}
--{{ name }}-python {{ COMMON_BIN_DIR }}/{{ item.python }} --{{ name }}-code-dir {{ item.code }}
{%- if item.env is defined %} --{{ name }}-env {{ item.env }}{% endif %} \
{% endif %}
{%- endfor -%}
--available={{ supervisor_available_dir }} --enabled={{ supervisor_cfg_dir }}
{% endif %}
# User will be applied only to ExecStart, not other commands (i.e. ExecStartPre)
# This is needed because pre_supervisor needs to write to supervisor/conf.d, which
# supervisor_service_user does not have permission to do.
PermissionsStartOnly=true
User={{ supervisor_service_user }}
Type=forking
TimeoutStartSec=432000
ExecStart={{ supervisor_venv_dir }}/bin/supervisord --configuration {{ supervisor_cfg }}
ExecReload={{ supervisor_venv_dir }}/bin/supervisorctl reload
ExecStop={{ supervisor_venv_dir }}/bin/supervisorctl shutdown
[Install]
WantedBy=multi-user.target
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment