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
c0efbd3d
Commit
c0efbd3d
authored
Jun 25, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create api users
parent
86a75402
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
44 deletions
+53
-44
playbooks/roles/analytics-api/defaults/main.yml
+38
-32
playbooks/roles/analytics-api/tasks/deploy.yml
+15
-7
playbooks/roles/edxapp/defaults/main.yml
+0
-5
No files found.
playbooks/roles/analytics-api/defaults/main.yml
View file @
c0efbd3d
...
...
@@ -20,6 +20,44 @@ ANALYTICS_API_PIP_EXTRA_ARGS: "-i {{ COMMON_PYPI_MIRROR_URL }}"
ANALYTICS_API_NGINX_PORT
:
"
18100"
ANALYTICS_API_VERSION
:
"
master"
# Default dummy user, override this!!
ANALYTICS_API_USERS
:
"
dummy-api-user"
:
"
changeme"
ANALYTICS_API_CONFIG
:
SECRET_KEY
:
'
Your
secret
key
here'
TIME_ZONE
:
'
America/New_York'
LANGUAGE_CODE
:
'
en-us'
# email config
EMAIL_HOST
:
'
smtp.example.com'
EMAIL_HOST_PASSWORD
:
"
"
EMAIL_HOST_USER
:
"
"
EMAIL_PORT
:
587
API_AUTH_TOKEN
:
'
put-your-api-token-here'
STATICFILES_DIRS
:
[]
STATIC_ROOT
:
"
{{
COMMON_DATA_DIR
}}/{{
analytics_api_service_name
}}/staticfiles"
# db config
DATABASE_OPTIONS
:
connect_timeout
:
10
DATABASES
:
# rw user
default
:
ENGINE
:
'
django.db.backends.mysql'
NAME
:
'
analytics-api'
USER
:
'
api001'
PASSWORD
:
'
password'
HOST
:
'
localhost'
PORT
:
'
3306'
# read-only user
reports
:
ENGINE
:
'
django.db.backends.mysql'
NAME
:
'
reports'
USER
:
'
reports001'
PASSWORD
:
'
password'
HOST
:
'
localhost'
PORT
:
'
3306'
#
# vars are namespace with the module name.
#
...
...
@@ -57,38 +95,6 @@ analytics_api_requirements:
-
production.txt
-
optional.txt
ANALYTICS_API_CONFIG
:
SECRET_KEY
:
'
Your
secret
key
here'
TIME_ZONE
:
'
America/New_York'
LANGUAGE_CODE
:
'
en-us'
# email config
EMAIL_HOST
:
'
smtp.example.com'
EMAIL_HOST_PASSWORD
:
"
"
EMAIL_HOST_USER
:
"
"
EMAIL_PORT
:
587
API_AUTH_TOKEN
:
'
put-your-api-token-here'
STATICFILES_DIRS
:
[]
STATIC_ROOT
:
"
{{
COMMON_DATA_DIR
}}/{{
analytics_api_service_name
}}/staticfiles"
# db config
DATABASE_OPTIONS
:
connect_timeout
:
10
DATABASES
:
# rw user
default
:
ENGINE
:
'
django.db.backends.mysql'
NAME
:
'
analytics-api'
USER
:
'
api001'
PASSWORD
:
'
password'
HOST
:
'
localhost'
PORT
:
'
3306'
# read-only user
reports
:
ENGINE
:
'
django.db.backends.mysql'
NAME
:
'
reports'
USER
:
'
reports001'
PASSWORD
:
'
password'
HOST
:
'
localhost'
PORT
:
'
3306'
#
# OS packages
#
...
...
playbooks/roles/analytics-api/tasks/deploy.yml
View file @
c0efbd3d
...
...
@@ -29,13 +29,6 @@
mode=0644 owner={{ analytics_api_user }} group={{ analytics_api_user }}
notify
:
restart the analytics service
-
name
:
run collectstatic
shell
:
>
chdir={{ analytics_api_code_dir }}
{{ analytics_api_venv_bin }}/python manage.py collectstatic --settings analyticsdataserver.settings.production --noinput --settings analyticsdataserver.settings.production
sudo_user
:
"
{{
analytics_api_user
}}"
environment
:
"
{{
analytics_api_environment
}}"
-
name
:
install application requirements
pip
:
>
requirements="{{ analytics_api_requirements_base }}/{{ item }}"
...
...
@@ -54,6 +47,21 @@
environment
:
"
{{
analytics_api_environment
}}"
when
:
migrate_db is defined and migrate_db|lower == "yes"
-
name
:
run collectstatic
shell
:
>
chdir={{ analytics_api_code_dir }}
{{ analytics_api_venv_bin }}/python manage.py collectstatic --noinput
sudo_user
:
"
{{
analytics_api_user
}}"
environment
:
"
{{
analytics_api_environment
}}"
-
name
:
create api users
shell
:
>
chdir={{ analytics_api_code_dir }}
{{ analytics_api_venv_bin }}/python manage.py set_api_key {{ item.key }} {{ item.value }} --create-user
sudo_user
:
"
{{
analytics_api_user
}}"
environment
:
"
{{
analytics_api_environment
}}"
with_dict
:
ANALYTICS_API_USERS
-
name
:
write out the supervisior wrapper
template
:
>
src=edx/app/analytics-api/analytics-api.sh.j2
...
...
playbooks/roles/edxapp/defaults/main.yml
View file @
c0efbd3d
...
...
@@ -32,11 +32,9 @@ EDXAPP_MONGO_DB_NAME: 'edxapp'
EDXAPP_MYSQL_DB_NAME
:
'
edxapp'
EDXAPP_MYSQL_USER
:
'
edxapp001'
EDXAPP_MYSQL_USER_ADMIN
:
'
root'
EDXAPP_MYSQL_USER_MIGRATE
:
'
migrate'
EDXAPP_MYSQL_PASSWORD
:
'
password'
EDXAPP_MYSQL_PASSWORD_READ_ONLY
:
'
password'
EDXAPP_MYSQL_PASSWORD_ADMIN
:
'
password'
EDXAPP_MYSQL_PASSWORD_MIGRATE
:
'
password'
EDXAPP_MYSQL_REPLICA_DB_NAME
:
"
{{
EDXAPP_MYSQL_DB_NAME
}}"
EDXAPP_MYSQL_REPLICA_USER
:
"
{{
EDXAPP_MYSQL_USER
}}"
EDXAPP_MYSQL_REPLICA_PASSWORD
:
"
{{
EDXAPP_MYSQL_PASSWORD
}}"
...
...
@@ -185,9 +183,6 @@ EDXAPP_USE_GIT_IDENTITY: false
# into this var
EDXAPP_GIT_IDENTITY
:
!!null
# Configuration for database migration
EDXAPP_TEST_MIGRATE_DB_NAME
:
"
{{
COMMON_ENVIRONMENT
}}_{{
COMMON_DEPLOYMENT
}}_test_{{
EDXAPP_MYSQL_DB_NAME
}}"
EDXAPP_UPDATE_STATIC_FILES_KEY
:
false
# Set this to true if you want to install the private pip
# requirements in the edx-platform repo.
...
...
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