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
edx
configuration
Commits
27a93364
Commit
27a93364
authored
Feb 23, 2016
by
Fred Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restructure notes_api deployment
parent
a514fb9c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
12 deletions
+70
-12
playbooks/roles/edx_notes_api/defaults/main.yml
+11
-0
playbooks/roles/edx_notes_api/tasks/main.yml
+24
-0
playbooks/roles/edx_notes_api/templates/edx/app/edx_notes_api/edx_notes_api.sh.j2
+23
-0
playbooks/roles/edx_notes_api/templates/edx/app/edx_notes_api/edx_notes_api_env.j2
+7
-0
playbooks/roles/edx_notes_api/templates/edx/app/supervisor/conf.d.available/edx_notes_api.conf.j2
+5
-12
No files found.
playbooks/roles/edx_notes_api/defaults/main.yml
View file @
27a93364
...
...
@@ -28,6 +28,7 @@ EDX_NOTES_API_CLIENT_ID: "CHANGEME"
EDX_NOTES_API_CLIENT_SECRET
:
"
CHANGEME"
EDX_NOTES_API_GIT_SSH_KEY
:
!!null
EDX_NOTES_API_VERSION
:
master
EDX_NOTES_API_DJANGO_SETTINGS_MODULE
:
'
notesserver.settings.yaml_config'
EDX_NOTES_API_DATABASES
:
# rw user
...
...
@@ -81,11 +82,21 @@ edx_notes_api_service_config:
#
# vars are namespace with the module name.
#
edx_notes_api_environment
:
EDXNOTES_CONFIG_ROOT
:
"
{{
COMMON_CFG_DIR
}}"
LANG
:
"
{{
EDX_NOTES_API_LANG
}}"
DJANGO_SETTINGS_MODULE
:
"
{{
EDX_NOTES_API_DJANGO_SETTINGS_MODULE
}}"
SERVICE_VARIANT
:
"
{{
edx_notes_api_service_name
}}"
PATH
:
"
{{
edx_notes_api_venv_dir
}}/bin:{{
ansible_env.PATH
}}"
edx_notes_api_service_name
:
edx_notes_api
edx_notes_api_user
:
"
{{
edx_notes_api_service_name
}}"
edx_notes_api_home
:
"
{{
COMMON_APP_DIR
}}/{{
edx_notes_api_service_name
}}"
edx_notes_api_code_dir
:
"
{{
edx_notes_api_home
}}/{{
edx_notes_api_service_name
}}"
edx_notes_api_conf_dir
:
"
{{
edx_notes_api_home
}}"
edx_notes_api_venv_dir
:
"
{{
edx_notes_api_home
}}/venvs/{{
edx_notes_api_service_name
}}"
edx_notes_api_gunicorn_host
:
"
127.0.0.1"
edx_notes_api_gunicorn_port
:
8120
...
...
playbooks/roles/edx_notes_api/tasks/main.yml
View file @
27a93364
...
...
@@ -71,6 +71,18 @@
tags
:
-
deploy
-
name
:
write out the supervisor wrapper
template
:
src
:
"
edx/app/edx_notes_api/edx_notes_api.sh.j2"
dest
:
"
{{
edx_notes_api_home
}}/{{
edx_notes_api_service_name
}}.sh"
mode
:
0650
owner
:
"
{{
supervisor_user
}}"
group
:
"
{{
common_web_user
}}"
tags
:
-
install
-
install:configuration
-
name
:
write supervisord config
template
:
>
src=edx/app/supervisor/conf.d.available/edx_notes_api.conf.j2
...
...
@@ -79,6 +91,18 @@
tags
:
-
deploy
-
name
:
setup the edx_notes_api env file
template
:
src
:
"
edx/app/edx_notes_api/edx_notes_api_env.j2"
dest
:
"
{{
edx_notes_api_home
}}/{{
edx_notes_api_service_name}}_env"
owner
:
"
{{
edx_notes_api_user
}}"
group
:
"
{{
edx_notes_api_user
}}"
mode
:
0644
tags
:
-
install
-
install:configuration
-
name
:
enable supervisor script
file
:
>
src={{ supervisor_available_dir }}/{{ edx_notes_api_service_name }}.conf
...
...
playbooks/roles/edx_notes_api/templates/edx/app/edx_notes_api/edx_notes_api.sh.j2
0 → 100644
View file @
27a93364
#!/usr/bin/env bash
# {{ ansible_managed }}
{
%
set
edx_notes_api_venv_bin
=
edx_notes_api_home +
'/venvs/'
+ edx_notes_api_service_name +
'/bin'
%
}
{
%
if
COMMON_ENABLE_NEWRELIC_APP %
}
{
%
set
executable
=
edx_notes_api_venv_bin +
'/newrelic-admin run-program '
+ edx_notes_api_venv_bin +
'/gunicorn'
%
}
{
%
else
%
}
{
%
set
executable
=
edx_notes_api_venv_bin +
'/gunicorn'
%
}
{
% endif %
}
{
%
if
COMMON_ENABLE_NEWRELIC_APP %
}
export
NEW_RELIC_APP_NAME
=
"{{ EDX_NOTES_API_NEWRELIC_APPNAME }}"
export
NEW_RELIC_LICENSE_KEY
=
"{{ NEWRELIC_LICENSE_KEY }}"
{
% endif -%
}
source
{{
edx_notes_api_home
}}
/edx_notes_api_env
export
PID
=
/var/tmp/edx_notes_api.pid
export
PORT
={{
edx_notes_api_gunicorn_port
}}
export
ADDRESS
={{
edx_notes_api_gunicorn_host
}}
{{
executable
}}
-c
{{
edx_notes_api_home
}}
/edx_notes_api_gunicorn.py
{{
EDX_NOTES_API_GUNICORN_WORKERS_EXTRA
}}
{{
edx_notes_api_wsgi
}}
playbooks/roles/edx_notes_api/templates/edx/app/edx_notes_api/edx_notes_api_env.j2
0 → 100644
View file @
27a93364
# {{ ansible_managed }}
{% for name,value in edx_notes_api_environment.items() -%}
{%- if value -%}
export {{ name }}="{{ value }}"
{% endif %}
{%- endfor %}
playbooks/roles/edx_notes_api/templates/edx/app/supervisor/conf.d.available/edx_notes_api.conf.j2
View file @
27a93364
[program:{{ edx_notes_api_service_name }}]
{% set edx_notes_api_venv_bin = edx_notes_api_home + '/venvs/' + edx_notes_api_service_name + '/bin' %}
{% if COMMON_ENABLE_NEWRELIC_APP %}
{% set executable = edx_notes_api_venv_bin + '/newrelic-admin run-program ' + edx_notes_api_venv_bin + '/gunicorn' %}
{% else %}
{% set executable = edx_notes_api_venv_bin + '/gunicorn' %}
{% endif %}
#
# {{ ansible_managed }}
#
command={{ executable }} -c {{ edx_notes_api_home }}/edx_notes_api_gunicorn.py {{ EDX_NOTES_API_GUNICORN_WORKERS_EXTRA }} {{ edx_notes_api_wsgi }}
[program:{{ edx_notes_api_service_name }}]
command={{ edx_notes_api_home }}/{{ edx_notes_api_service_name }}.sh
user={{ common_web_user }}
directory={{ edx_notes_api_code_dir }}
environment={% if COMMON_ENABLE_NEWRELIC_APP %}NEW_RELIC_APP_NAME={{ EDX_NOTES_API_NEWRELIC_APPNAME }},NEW_RELIC_LICENSE_KEY={{ NEWRELIC_LICENSE_KEY }},{% endif -%}PID=/var/tmp/edx_notes_api.pid,PORT={{ edx_notes_api_gunicorn_port }},ADDRESS={{ edx_notes_api_gunicorn_host }},LANG={{ EDX_NOTES_API_LANG }},DJANGO_SETTINGS_MODULE=notesserver.settings.yaml_config,SERVICE_VARIANT="{{ edx_notes_api_service_name }}",EDXNOTES_CONFIG_ROOT="{{ COMMON_CFG_DIR }}"
stdout_logfile={{ supervisor_log_dir }}/%(program_name)-stdout.log
stderr_logfile={{ supervisor_log_dir }}/%(program_name)-stderr.log
killasgroup=true
...
...
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