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
cf3f7b3c
Commit
cf3f7b3c
authored
Mar 12, 2015
by
Feanil Patel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1897 from edx/feanil/ecommerce
Feanil/ecommerce
parents
4253f61f
c0432e74
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
208 additions
and
208 deletions
+208
-208
playbooks/edx-east/ecommerce.yml
+2
-2
playbooks/roles/ecommerce/defaults/main.yml
+130
-0
playbooks/roles/ecommerce/meta/main.yml
+8
-8
playbooks/roles/ecommerce/tasks/main.yml
+31
-31
playbooks/roles/ecommerce/templates/edx/app/ecommerce/ecommerce.sh.j2
+6
-6
playbooks/roles/ecommerce/templates/edx/app/ecommerce/ecommerce_env.j2
+1
-1
playbooks/roles/ecommerce/templates/edx/app/ecommerce/ecommerce_gunicorn.py.j2
+11
-0
playbooks/roles/ecommerce/templates/edx/app/supervisor/conf.d.available/ecommerce.conf.j2
+3
-3
playbooks/roles/edx_ecommerce/defaults/main.yml
+0
-130
playbooks/roles/edx_ecommerce/templates/edx/app/edx_ecommerce/edx_ecommerce_gunicorn.py.j2
+0
-11
playbooks/roles/edxlocal/tasks/main.yml
+9
-9
playbooks/roles/nginx/defaults/main.yml
+1
-1
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_ecommerce.j2
+6
-6
No files found.
playbooks/edx-east/e
dx_e
commerce.yml
→
playbooks/edx-east/ecommerce.yml
View file @
cf3f7b3c
...
...
@@ -9,9 +9,9 @@
roles
:
-
role
:
nginx
nginx_sites
:
-
e
dx_e
commerce
-
ecommerce
-
aws
-
e
dx_e
commerce
-
ecommerce
-
role
:
datadog
when
:
COMMON_ENABLE_DATADOG
-
role
:
splunkforwarder
...
...
playbooks/roles/ecommerce/defaults/main.yml
0 → 100644
View file @
cf3f7b3c
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role ecommerce
#
ECOMMERCE_GIT_IDENTITY
:
!!null
# depends upon Newrelic being enabled via COMMON_ENABLE_NEWRELIC
# and a key being provided via NEWRELIC_LICENSE_KEY
ECOMMERCE_NEWRELIC_APPNAME
:
"
{{
COMMON_ENVIRONMENT
}}-{{
COMMON_DEPLOYMENT
}}-{{
ecommerce_service_name
}}"
ECOMMERCE_PIP_EXTRA_ARGS
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}"
ECOMMERCE_NGINX_PORT
:
"
18130"
ECOMMERCE_DEFAULT_DB_NAME
:
'
ecommerce'
ECOMMERCE_DATABASES
:
# rw user
default
:
ENGINE
:
'
django.db.backends.mysql'
NAME
:
'
{{
ECOMMERCE_DEFAULT_DB_NAME
}}'
USER
:
'
ecomm001'
PASSWORD
:
'
password'
HOST
:
'
localhost'
PORT
:
'
3306'
ECOMMERCE_VERSION
:
"
master"
EDX_DJANGO_OSCAR_VERSION
:
"
master"
EDX_DJANGO_OSCAR_EXTENSIONS_VERSION
:
"
master"
# Default dummy user, override this!!
ECOMMERCE_USERS
:
"
dummy-api-user"
:
"
changeme"
ECOMMERCE_SECRET_KEY
:
'
Your
secret
key
here'
ECOMMERCE_TIME_ZONE
:
'
UTC'
ECOMMERCE_LANGUAGE_CODE
:
'
en-us'
ECOMMERCE_EMAIL_HOST
:
'
localhost'
ECOMMERCE_EMAIL_HOST_USER
:
'
mail_user'
ECOMMERCE_EMAIL_HOST_PASSWORD
:
'
mail_password'
ECOMMERCE_EMAIL_PORT
:
587
ECOMMERCE_AUTH_TOKEN
:
'
put-your-api-token-here'
ECOMMERCE_SERVICE_CONFIG
:
ECOMMERCE_DATABASE
:
'
reports'
SECRET_KEY
:
'
{{
ECOMMERCE_SECRET_KEY
}}'
TIME_ZONE
:
'
{{
ECOMMERCE_TIME_ZONE
}}'
LANGUAGE_CODE
:
'
{{ECOMMERCE_LANGUAGE_CODE
}}'
# email config
EMAIL_HOST
:
'
{{
ECOMMERCE_EMAIL_HOST
}}'
EMAIL_HOST_PASSWORD
:
'
{{
ECOMMERCE_EMAIL_HOST_PASSWORD
}}'
EMAIL_HOST_USER
:
'
{{
ECOMMERCE_EMAIL_HOST_USER
}}'
EMAIL_PORT
:
$ECOMMERCE_EMAIL_PORT
API_AUTH_TOKEN
:
'
{{
ECOMMERCE_AUTH_TOKEN
}}'
STATICFILES_DIRS
:
[]
# STATICFILES_DIRS: ['{{ ecommerce_static_path }}']
STATIC_ROOT
:
"
{{
COMMON_DATA_DIR
}}/{{
ecommerce_service_name
}}/staticfiles"
# db config
DATABASE_OPTIONS
:
connect_timeout
:
10
DATABASES
:
'
{{
ECOMMERCE_DATABASES
}}'
ECOMMERCE_REPOS
:
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
DOMAIN
:
"
{{
COMMON_GIT_MIRROR
}}"
PATH
:
"
{{
COMMON_GIT_PATH
}}"
REPO
:
edx-ecommerce.git
VERSION
:
"
{{
ECOMMERCE_VERSION
}}"
DESTINATION
:
"
{{
ecommerce_code_dir
}}"
SSH_KEY
:
"
{{
ECOMMERCE_GIT_IDENTITY
}}"
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
DOMAIN
:
"
{{
COMMON_GIT_MIRROR
}}"
PATH
:
"
{{
COMMON_GIT_PATH
}}"
REPO
:
django-oscar.git
VERSION
:
"
{{
EDX_DJANGO_OSCAR_VERSION
}}"
DESTINATION
:
"
{{
ecommerce_home
}}/depends/django-oscar"
SSH_KEY
:
"
{{
ECOMMERCE_GIT_IDENTITY
}}"
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
DOMAIN
:
"
{{
COMMON_GIT_MIRROR
}}"
PATH
:
"
{{
COMMON_GIT_PATH
}}"
REPO
:
django-oscar-extensions.git
VERSION
:
"
{{
EDX_DJANGO_OSCAR_EXTENSIONS_VERSION
}}"
DESTINATION
:
"
{{
ecommerce_home
}}/depends/django-oscar-extensions"
SSH_KEY
:
"
{{
ECOMMERCE_GIT_IDENTITY
}}"
ECOMMERCE_GUNICORN_WORKERS
:
"
2"
ECOMMERCE_GUNICORN_EXTRA
:
"
"
ECOMMERCE_GUNICORN_EXTRA_CONF
:
"
"
#
# vars are namespace with the module name.
#
ecommerce_environment
:
DJANGO_SETTINGS_MODULE
:
"
ecommerce.settings.production"
ECOMMERCE_CFG
:
"
{{
COMMON_CFG_DIR
}}/{{
ecommerce_service_name
}}.yml"
ecommerce_service_name
:
"
ecommerce"
ecommerce_user
:
"
{{
ecommerce_service_name
}}"
ecommerce_home
:
"
{{
COMMON_APP_DIR
}}/{{
ecommerce_service_name
}}"
ecommerce_code_dir
:
"
{{
ecommerce_home
}}/{{
ecommerce_service_name
}}"
ecommerce_static_path
:
"
{{
ecommerce_code_dir
}}/ecommerce/static"
ecommerce_gunicorn_host
:
"
127.0.0.1"
ecommerce_gunicorn_port
:
"
8130"
ecommerce_gunicorn_timeout
:
"
300"
ecommerce_log_dir
:
"
{{
COMMON_LOG_DIR
}}/{{
ecommerce_service_name
}}"
ecommerce_requirements_base
:
"
{{
ecommerce_code_dir
}}/requirements"
ecommerce_requirements
:
-
production.txt
#- optional.txt
#
# OS packages
#
ecommerce_debian_pkgs
:
-
libmysqlclient-dev
-
libjpeg-dev
ecommerce_redhat_pkgs
:
[]
playbooks/roles/e
dx_e
commerce/meta/main.yml
→
playbooks/roles/ecommerce/meta/main.yml
View file @
cf3f7b3c
...
...
@@ -8,16 +8,16 @@
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Role includes for role e
dx_e
commerce
# Role includes for role ecommerce
#
dependencies
:
-
role
:
edx_service
edx_service_name
:
"
{{
e
dx_e
commerce_service_name
}}"
edx_service_config
:
"
{{
E
DX_E
COMMERCE_SERVICE_CONFIG
}}"
edx_service_repos
:
"
{{
E
DX_E
COMMERCE_REPOS
}}"
edx_service_user
:
"
{{
e
dx_e
commerce_user
}}"
edx_service_home
:
"
{{
e
dx_e
commerce_home
}}"
edx_service_name
:
"
{{
ecommerce_service_name
}}"
edx_service_config
:
"
{{
ECOMMERCE_SERVICE_CONFIG
}}"
edx_service_repos
:
"
{{
ECOMMERCE_REPOS
}}"
edx_service_user
:
"
{{
ecommerce_user
}}"
edx_service_home
:
"
{{
ecommerce_home
}}"
edx_service_packages
:
debian
:
"
{{
e
dx_e
commerce_debian_pkgs
}}"
redhat
:
"
{{
e
dx_e
commerce_redhat_pkgs
}}"
debian
:
"
{{
ecommerce_debian_pkgs
}}"
redhat
:
"
{{
ecommerce_redhat_pkgs
}}"
-
supervisor
playbooks/roles/e
dx_e
commerce/tasks/main.yml
→
playbooks/roles/ecommerce/tasks/main.yml
View file @
cf3f7b3c
...
...
@@ -9,7 +9,7 @@
#
#
#
# Tasks for role e
dx_e
commerce
# Tasks for role ecommerce
#
# Overview:
#
...
...
@@ -23,59 +23,59 @@
-
name
:
"
add
gunicorn
configuration
file"
template
:
>
src=edx/app/e
dx_ecommerce/edx_
ecommerce_gunicorn.py.j2
dest={{ e
dx_ecommerce_home }}/edx_
ecommerce_gunicorn.py
sudo_user
:
"
{{
e
dx_e
commerce_user
}}"
src=edx/app/e
commerce/
ecommerce_gunicorn.py.j2
dest={{ e
commerce_home }}/
ecommerce_gunicorn.py
sudo_user
:
"
{{
ecommerce_user
}}"
-
name
:
install application requirements
pip
:
>
requirements="{{ e
dx_e
commerce_requirements_base }}/{{ item }}"
virtualenv="{{ e
dx_ecommerce_home }}/venvs/{{ edx_
ecommerce_service_name }}"
requirements="{{ ecommerce_requirements_base }}/{{ item }}"
virtualenv="{{ e
commerce_home }}/venvs/{{
ecommerce_service_name }}"
state=present
sudo_user
:
"
{{
e
dx_e
commerce_user
}}"
with_items
:
e
dx_e
commerce_requirements
sudo_user
:
"
{{
ecommerce_user
}}"
with_items
:
ecommerce_requirements
-
name
:
migrate
shell
:
>
chdir={{ e
dx_e
commerce_code_dir }}
chdir={{ ecommerce_code_dir }}
DB_MIGRATION_USER={{ COMMON_MYSQL_MIGRATE_USER }}
DB_MIGRATION_PASS={{ COMMON_MYSQL_MIGRATE_PASS }}
{{ e
dx_ecommerce_home }}/venvs/{{ edx_
ecommerce_service_name }}/bin/python ./manage.py migrate --noinput
sudo_user
:
"
{{
e
dx_e
commerce_user
}}"
environment
:
"
{{
e
dx_e
commerce_environment
}}"
{{ e
commerce_home }}/venvs/{{
ecommerce_service_name }}/bin/python ./manage.py migrate --noinput
sudo_user
:
"
{{
ecommerce_user
}}"
environment
:
"
{{
ecommerce_environment
}}"
when
:
migrate_db is defined and migrate_db|lower == "yes"
-
name
:
run collectstatic
shell
:
>
chdir={{ e
dx_e
commerce_code_dir }}
{{ e
dx_ecommerce_home }}/venvs/{{ edx_
ecommerce_service_name }}/bin/python manage.py collectstatic --noinput
sudo_user
:
"
{{
e
dx_e
commerce_user
}}"
environment
:
"
{{
e
dx_e
commerce_environment
}}"
chdir={{ ecommerce_code_dir }}
{{ e
commerce_home }}/venvs/{{
ecommerce_service_name }}/bin/python manage.py collectstatic --noinput
sudo_user
:
"
{{
ecommerce_user
}}"
environment
:
"
{{
ecommerce_environment
}}"
-
name
:
write out the supervisor wrapper
template
:
>
src=edx/app/e
dx_ecommerce/edx_
ecommerce.sh.j2
dest={{ e
dx_ecommerce_home }}/{{ edx_
ecommerce_service_name }}.sh
src=edx/app/e
commerce/
ecommerce.sh.j2
dest={{ e
commerce_home }}/{{
ecommerce_service_name }}.sh
mode=0650 owner={{ supervisor_user }} group={{ common_web_user }}
-
name
:
write supervisord config
template
:
>
src=edx/app/supervisor/conf.d.available/e
dx_e
commerce.conf.j2
dest="{{ supervisor_available_dir }}/{{ e
dx_e
commerce_service_name }}.conf"
src=edx/app/supervisor/conf.d.available/ecommerce.conf.j2
dest="{{ supervisor_available_dir }}/{{ ecommerce_service_name }}.conf"
owner={{ supervisor_user }} group={{ common_web_user }} mode=0644
-
name
:
setup the ecommence env file
template
:
>
src="./{{ e
dx_ecommerce_home }}/{{ edx_
ecommerce_service_name }}_env.j2"
dest="{{ e
dx_ecommerce_home }}/edx_
ecommerce_env"
owner={{ e
dx_e
commerce_user }}
group={{ e
dx_e
commerce_user }}
src="./{{ e
commerce_home }}/{{
ecommerce_service_name }}_env.j2"
dest="{{ e
commerce_home }}/
ecommerce_env"
owner={{ ecommerce_user }}
group={{ ecommerce_user }}
mode=0644
-
name
:
enable supervisor script
file
:
>
src={{ supervisor_available_dir }}/{{ e
dx_e
commerce_service_name }}.conf
dest={{ supervisor_cfg_dir }}/{{ e
dx_e
commerce_service_name }}.conf
src={{ supervisor_available_dir }}/{{ ecommerce_service_name }}.conf
dest={{ supervisor_cfg_dir }}/{{ ecommerce_service_name }}.conf
state=link
force=yes
when
:
not disable_edx_services
...
...
@@ -86,8 +86,8 @@
-
name
:
create symlinks from the-er venv bin dir
file
:
>
src="{{ e
dx_ecommerce_home }}/venvs/{{ edx_
ecommerce_service_name }}/bin/{{ item }}"
dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.e
dx_e
commerce"
src="{{ e
commerce_home }}/venvs/{{
ecommerce_service_name }}/bin/{{ item }}"
dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.ecommerce"
state=link
with_items
:
-
python
...
...
@@ -96,8 +96,8 @@
-
name
:
create symlinks from the repo dir
file
:
>
src="{{ e
dx_e
commerce_code_dir }}/{{ item }}"
dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.e
dx_e
commerce"
src="{{ ecommerce_code_dir }}/{{ item }}"
dest="{{ COMMON_BIN_DIR }}/{{ item.split('.')[0] }}.ecommerce"
state=link
with_items
:
-
manage.py
...
...
@@ -107,6 +107,6 @@
state=restarted
supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
name={{ e
dx_e
commerce_service_name }}
name={{ ecommerce_service_name }}
when
:
not disable_edx_services
sudo_user
:
"
{{
supervisor_service_user
}}"
playbooks/roles/e
dx_ecommerce/templates/edx/app/edx_ecommerce/edx_
ecommerce.sh.j2
→
playbooks/roles/e
commerce/templates/edx/app/ecommerce/
ecommerce.sh.j2
View file @
cf3f7b3c
...
...
@@ -2,18 +2,18 @@
{{
ansible_managed
}}
{
%
set
e
dx_ecommerce_venv_bin
=
edx_ecommerce_home +
"/venvs/"
+ edx_
ecommerce_service_name +
"/bin"
%
}
{
%
set
e
commerce_venv_bin
=
ecommerce_home +
"/venvs/"
+
ecommerce_service_name +
"/bin"
%
}
{
%
if
COMMON_ENABLE_NEWRELIC_APP %
}
{
%
set
executable
=
e
dx_ecommerce_venv_bin +
'/newrelic-admin run-program '
+ edx_
ecommerce_venv_bin +
'/gunicorn'
%
}
{
%
set
executable
=
e
commerce_venv_bin +
'/newrelic-admin run-program '
+
ecommerce_venv_bin +
'/gunicorn'
%
}
{
%
else
%
}
{
%
set
executable
=
e
dx_e
commerce_venv_bin +
'/gunicorn'
%
}
{
%
set
executable
=
ecommerce_venv_bin +
'/gunicorn'
%
}
{
% endif %
}
{
%
if
COMMON_ENABLE_NEWRELIC_APP %
}
export
NEW_RELIC_APP_NAME
=
"{{ E
DX_E
COMMERCE_NEWRELIC_APPNAME }}"
export
NEW_RELIC_APP_NAME
=
"{{ ECOMMERCE_NEWRELIC_APPNAME }}"
export
NEW_RELIC_LICENSE_KEY
=
"{{ NEWRELIC_LICENSE_KEY }}"
{
% endif -%
}
source
{{
e
dx_ecommerce_home
}}
/edx_
ecommerce_env
source
{{
e
commerce_home
}}
/
ecommerce_env
# TODO fix application
{{
executable
}}
-c
{{
e
dx_ecommerce_home
}}
/edx_ecommerce_gunicorn.py
{{
EDX_
ECOMMERCE_GUNICORN_EXTRA
}}
ecommerce.wsgi:application
{{
executable
}}
-c
{{
e
commerce_home
}}
/ecommerce_gunicorn.py
{{
ECOMMERCE_GUNICORN_EXTRA
}}
ecommerce.wsgi:application
playbooks/roles/e
dx_ecommerce/templates/edx/app/edx_ecommerce/edx_
ecommerce_env.j2
→
playbooks/roles/e
commerce/templates/edx/app/ecommerce/
ecommerce_env.j2
View file @
cf3f7b3c
# {{ ansible_managed }}
{% for name,value in e
dx_e
commerce_environment.items() -%}
{% for name,value in ecommerce_environment.items() -%}
{%- if value -%}
export {{ name }}="{{ value }}"
{% endif %}
...
...
playbooks/roles/ecommerce/templates/edx/app/ecommerce/ecommerce_gunicorn.py.j2
0 → 100644
View file @
cf3f7b3c
"""
gunicorn configuration file: http://docs.gunicorn.org/en/develop/configure.html
{{ ansible_managed }}
"""
timeout = {{ ecommerce_gunicorn_timeout }}
bind = "{{ ecommerce_gunicorn_host }}:{{ ecommerce_gunicorn_port }}"
pythonpath = "{{ ecommerce_code_dir }}"
workers = {{ ECOMMERCE_GUNICORN_WORKERS }}
{{ ECOMMERCE_GUNICORN_EXTRA_CONF }}
playbooks/roles/e
dx_ecommerce/templates/edx/app/supervisor/conf.d.available/edx_
ecommerce.conf.j2
→
playbooks/roles/e
commerce/templates/edx/app/supervisor/conf.d.available/
ecommerce.conf.j2
View file @
cf3f7b3c
#
# {{ ansible_managed }}
#
[program:{{ e
dx_e
commerce_service_name }}]
[program:{{ ecommerce_service_name }}]
command={{ e
dx_ecommerce_home }}/{{ edx_
ecommerce_service_name }}.sh
command={{ e
commerce_home }}/{{
ecommerce_service_name }}.sh
user={{ common_web_user }}
directory={{ e
dx_e
commerce_code_dir }}
directory={{ ecommerce_code_dir }}
stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log
stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log
killasgroup=true
...
...
playbooks/roles/edx_ecommerce/defaults/main.yml
deleted
100644 → 0
View file @
4253f61f
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://github.com/edx/configuration/wiki
# code style: https://github.com/edx/configuration/wiki/Ansible-Coding-Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Defaults for role edx_ecommerce
#
EDX_ECOMMERCE_GIT_IDENTITY
:
!!null
# depends upon Newrelic being enabled via COMMON_ENABLE_NEWRELIC
# and a key being provided via NEWRELIC_LICENSE_KEY
EDX_ECOMMERCE_NEWRELIC_APPNAME
:
"
{{
COMMON_ENVIRONMENT
}}-{{
COMMON_DEPLOYMENT
}}-{{
edx_ecommerce_service_name
}}"
EDX_ECOMMERCE_PIP_EXTRA_ARGS
:
"
-i
{{
COMMON_PYPI_MIRROR_URL
}}"
EDX_ECOMMERCE_NGINX_PORT
:
"
18130"
EDX_ECOMMERCE_DEFAULT_DB_NAME
:
'
edx_ecommerce'
EDX_ECOMMERCE_DATABASES
:
# rw user
default
:
ENGINE
:
'
django.db.backends.mysql'
NAME
:
'
{{
EDX_ECOMMERCE_DEFAULT_DB_NAME
}}'
USER
:
'
ecomm001'
PASSWORD
:
'
password'
HOST
:
'
localhost'
PORT
:
'
3306'
EDX_ECOMMERCE_VERSION
:
"
master"
EDX_DJANGO_OSCAR_VERSION
:
"
master"
EDX_DJANGO_OSCAR_EXTENSIONS_VERSION
:
"
master"
# Default dummy user, override this!!
EDX_ECOMMERCE_USERS
:
"
dummy-api-user"
:
"
changeme"
EDX_ECOMMERCE_SECRET_KEY
:
'
Your
secret
key
here'
EDX_ECOMMERCE_TIME_ZONE
:
'
UTC'
EDX_ECOMMERCE_LANGUAGE_CODE
:
'
en-us'
EDX_ECOMMERCE_EMAIL_HOST
:
'
localhost'
EDX_ECOMMERCE_EMAIL_HOST_USER
:
'
mail_user'
EDX_ECOMMERCE_EMAIL_HOST_PASSWORD
:
'
mail_password'
EDX_ECOMMERCE_EMAIL_PORT
:
587
EDX_ECOMMERCE_AUTH_TOKEN
:
'
put-your-api-token-here'
EDX_ECOMMERCE_SERVICE_CONFIG
:
EDX_ECOMMERCE_DATABASE
:
'
reports'
SECRET_KEY
:
'
{{
EDX_ECOMMERCE_SECRET_KEY
}}'
TIME_ZONE
:
'
{{
EDX_ECOMMERCE_TIME_ZONE
}}'
LANGUAGE_CODE
:
'
{{EDX_ECOMMERCE_LANGUAGE_CODE
}}'
# email config
EMAIL_HOST
:
'
{{
EDX_ECOMMERCE_EMAIL_HOST
}}'
EMAIL_HOST_PASSWORD
:
'
{{
EDX_ECOMMERCE_EMAIL_HOST_PASSWORD
}}'
EMAIL_HOST_USER
:
'
{{
EDX_ECOMMERCE_EMAIL_HOST_USER
}}'
EMAIL_PORT
:
$EDX_ECOMMERCE_EMAIL_PORT
API_AUTH_TOKEN
:
'
{{
EDX_ECOMMERCE_AUTH_TOKEN
}}'
STATICFILES_DIRS
:
[]
# STATICFILES_DIRS: ['{{ edx_ecommerce_static_path }}']
STATIC_ROOT
:
"
{{
COMMON_DATA_DIR
}}/{{
edx_ecommerce_service_name
}}/staticfiles"
# db config
DATABASE_OPTIONS
:
connect_timeout
:
10
DATABASES
:
'
{{
EDX_ECOMMERCE_DATABASES
}}'
EDX_ECOMMERCE_REPOS
:
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
DOMAIN
:
"
{{
COMMON_GIT_MIRROR
}}"
PATH
:
"
{{
COMMON_GIT_PATH
}}"
REPO
:
edx-ecommerce.git
VERSION
:
"
{{
EDX_ECOMMERCE_VERSION
}}"
DESTINATION
:
"
{{
edx_ecommerce_code_dir
}}"
SSH_KEY
:
"
{{
EDX_ECOMMERCE_GIT_IDENTITY
}}"
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
DOMAIN
:
"
{{
COMMON_GIT_MIRROR
}}"
PATH
:
"
{{
COMMON_GIT_PATH
}}"
REPO
:
django-oscar.git
VERSION
:
"
{{
EDX_DJANGO_OSCAR_VERSION
}}"
DESTINATION
:
"
{{
edx_ecommerce_home
}}/depends/django-oscar"
SSH_KEY
:
"
{{
EDX_ECOMMERCE_GIT_IDENTITY
}}"
-
PROTOCOL
:
"
{{
COMMON_GIT_PROTOCOL
}}"
DOMAIN
:
"
{{
COMMON_GIT_MIRROR
}}"
PATH
:
"
{{
COMMON_GIT_PATH
}}"
REPO
:
django-oscar-extensions.git
VERSION
:
"
{{
EDX_DJANGO_OSCAR_EXTENSIONS_VERSION
}}"
DESTINATION
:
"
{{
edx_ecommerce_home
}}/depends/django-oscar-extensions"
SSH_KEY
:
"
{{
EDX_ECOMMERCE_GIT_IDENTITY
}}"
EDX_ECOMMERCE_GUNICORN_WORKERS
:
"
2"
EDX_ECOMMERCE_GUNICORN_EXTRA
:
"
"
EDX_ECOMMERCE_GUNICORN_EXTRA_CONF
:
"
"
#
# vars are namespace with the module name.
#
edx_ecommerce_environment
:
DJANGO_SETTINGS_MODULE
:
"
ecommerce.settings.production"
EDX_ECOMMERCE_CFG
:
"
{{
COMMON_CFG_DIR
}}/{{
edx_ecommerce_service_name
}}.yml"
edx_ecommerce_service_name
:
"
edx_ecommerce"
edx_ecommerce_user
:
"
{{
edx_ecommerce_service_name
}}"
edx_ecommerce_home
:
"
{{
COMMON_APP_DIR
}}/{{
edx_ecommerce_service_name
}}"
edx_ecommerce_code_dir
:
"
{{
edx_ecommerce_home
}}/{{
edx_ecommerce_service_name
}}"
edx_ecommerce_static_path
:
"
{{
edx_ecommerce_code_dir
}}/ecommerce/static"
edx_ecommerce_gunicorn_host
:
"
127.0.0.1"
edx_ecommerce_gunicorn_port
:
"
8130"
edx_ecommerce_gunicorn_timeout
:
"
300"
edx_ecommerce_log_dir
:
"
{{
COMMON_LOG_DIR
}}/{{
edx_ecommerce_service_name
}}"
edx_ecommerce_requirements_base
:
"
{{
edx_ecommerce_code_dir
}}/requirements"
edx_ecommerce_requirements
:
-
production.txt
#- optional.txt
#
# OS packages
#
edx_ecommerce_debian_pkgs
:
-
libmysqlclient-dev
-
libjpeg-dev
edx_ecommerce_redhat_pkgs
:
[]
playbooks/roles/edx_ecommerce/templates/edx/app/edx_ecommerce/edx_ecommerce_gunicorn.py.j2
deleted
100644 → 0
View file @
4253f61f
"""
gunicorn configuration file: http://docs.gunicorn.org/en/develop/configure.html
{{ ansible_managed }}
"""
timeout = {{ edx_ecommerce_gunicorn_timeout }}
bind = "{{ edx_ecommerce_gunicorn_host }}:{{ edx_ecommerce_gunicorn_port }}"
pythonpath = "{{ edx_ecommerce_code_dir }}"
workers = {{ EDX_ECOMMERCE_GUNICORN_WORKERS }}
{{ EDX_ECOMMERCE_GUNICORN_EXTRA_CONF }}
playbooks/roles/edxlocal/tasks/main.yml
View file @
cf3f7b3c
...
...
@@ -102,19 +102,19 @@
encoding=utf8
when
:
INSIGHTS_DATABASES is defined
-
name
:
create database for e
dx_e
commerce
-
name
:
create database for ecommerce
mysql_db
:
>
db="{{ E
DX_E
COMMERCE_DEFAULT_DB_NAME }}"
db="{{ ECOMMERCE_DEFAULT_DB_NAME }}"
state=present
encoding=utf8
when
:
E
DX_E
COMMERCE_DEFAULT_DB_NAME is defined
when
:
ECOMMERCE_DEFAULT_DB_NAME is defined
-
name
:
setup users for e
dx_e
commerce
-
name
:
setup users for ecommerce
mysql_user
:
>
name="{{ E
DX_E
COMMERCE_DEFAULT_DB_NAME }}"
password="{{ E
DX_E
COMMERCE_DATABASES.default.PASSWORD }}"
priv='{{ E
DX_E
COMMERCE_DEFAULT_DB_NAME }}.*:SELECT,INSERT,UPDATE,DELETE'
when
:
E
DX_E
COMMERCE_DEFAULT_DB_NAME is defined
name="{{ ECOMMERCE_DEFAULT_DB_NAME }}"
password="{{ ECOMMERCE_DATABASES.default.PASSWORD }}"
priv='{{ ECOMMERCE_DEFAULT_DB_NAME }}.*:SELECT,INSERT,UPDATE,DELETE'
when
:
ECOMMERCE_DEFAULT_DB_NAME is defined
-
name
:
create api user for the analytics api
mysql_user
:
>
...
...
@@ -159,7 +159,7 @@
-
"
{{
ANALYTICS_API_DEFAULT_DB_NAME|default('None')
}}"
-
"
{{
ANALYTICS_API_REPORTS_DB_NAME|default('None')
}}"
-
"
{{
INSIGHTS_DATABASE_NAME|default('None')
}}"
-
"
{{
E
DX_E
COMMERCE_DEFAULT_DB_NAME|default('None')
}}"
-
"
{{
ECOMMERCE_DEFAULT_DB_NAME|default('None')
}}"
-
name
:
setup the read-only db user
mysql_user
:
>
...
...
playbooks/roles/nginx/defaults/main.yml
View file @
cf3f7b3c
...
...
@@ -93,7 +93,7 @@ nginx_gitreload_gunicorn_hosts:
-
127.0.0.1
nginx_edx_notes_api_gunicorn_hosts
:
-
127.0.0.1
nginx_e
dx_e
commerce_gunicorn_hosts
:
nginx_ecommerce_gunicorn_hosts
:
-
127.0.0.1
nginx_cfg
:
...
...
playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_ecommerce.j2
View file @
cf3f7b3c
#
# {{ ansible_managed }}
#
upstream e
dx_e
commerce_app_server {
{% for host in nginx_e
dx_e
commerce_gunicorn_hosts %}
server {{ host }}:{{ e
dx_e
commerce_gunicorn_port }} fail_timeout=0;
upstream ecommerce_app_server {
{% for host in nginx_ecommerce_gunicorn_hosts %}
server {{ host }}:{{ ecommerce_gunicorn_port }} fail_timeout=0;
{% endfor %}
}
server {
listen {{ E
DX_E
COMMERCE_NGINX_PORT }} default_server;
listen {{ ECOMMERCE_NGINX_PORT }} default_server;
location ~ ^/static/(?P<file>.*) {
root {{ COMMON_DATA_DIR }}/{{ e
dx_e
commerce_service_name }};
root {{ COMMON_DATA_DIR }}/{{ ecommerce_service_name }};
try_files /staticfiles/$file =404;
}
...
...
@@ -28,7 +28,7 @@ location @proxy_to_app {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://e
dx_e
commerce_app_server;
proxy_pass http://ecommerce_app_server;
}
}
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