This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 967
/
main.yml
252 lines (224 loc) · 10.1 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
#
# Defaults for role insights
#
INSIGHTS_LMS_BASE: 'http://127.0.0.1:8000'
INSIGHTS_CMS_BASE: 'http://127.0.0.1:8010'
INSIGHTS_BASE_URL: 'http://127.0.0.1:8110'
INSIGHTS_MEMCACHE: [ '127.0.0.1:11211' ]
INSIGHTS_MKTG_BASE: 'http://example.com'
INSIGHTS_LOGOUT_URL: '{{ INSIGHTS_MKTG_BASE }}/accounts/logout/'
INSIGHTS_PRIVACY_POLICY_URL: '{{ INSIGHTS_MKTG_BASE }}/privacy-policy'
INSIGHTS_TERMS_OF_SERVICE_URL: '{{ INSIGHTS_MKTG_BASE }}/terms-service'
INSIGHTS_SUPPORT_EMAIL: ''
INSIGHTS_CMS_COURSE_SHORTCUT_BASE_URL: '{{ INSIGHTS_LMS_BASE }}/course'
INSIGHTS_OAUTH2_SECRET: 'secret'
INSIGHTS_OAUTH2_URL_ROOT: '{{ INSIGHTS_LMS_BASE }}/oauth2'
INSIGHTS_OAUTH2_URL_LOGOUT: '{{ INSIGHTS_LMS_BASE }}/logout'
INSIGHTS_OAUTH2_APP_CLIENT_NAME: insights
INSIGHTS_OAUTH2_APP_USERNAME: staff
INSIGHTS_SOCIAL_AUTH_REDIRECT_IS_HTTPS: false
INSIGHTS_SECRET_KEY: 'YOUR_SECRET_KEY_HERE'
INSIGHTS_OAUTH2_KEY: 'YOUR_OAUTH2_KEY'
INSIGHTS_SOCIAL_AUTH_EDX_OAUTH2_KEY: 'insights-sso-key'
INSIGHTS_SOCIAL_AUTH_EDX_OAUTH2_SECRET: 'insights-sso-secret'
INSIGHTS_BACKEND_SERVICE_EDX_OAUTH2_KEY: 'insights-backend-service-key'
INSIGHTS_BACKEND_SERVICE_EDX_OAUTH2_SECRET: 'insights-backend-service-secret'
# This will not work on single instance sandboxes
INSIGHTS_DOC_BASE: 'http://127.0.0.1/en/latest'
ANALYTICS_API_ENDPOINT: 'http://127.0.0.1:8100/api/v0'
INSIGHTS_DATA_API_AUTH_TOKEN: 'changeme'
INSIGHTS_PLATFORM_NAME: 'edX'
INSIGHTS_APPLICATION_NAME: 'Insights'
INSIGHTS_SEGMENT_IO_KEY: 'YOUR_KEY'
# should match the timezone of your map reduce pipeline
INSIGHTS_TIME_ZONE: 'UTC'
INSIGHTS_LANGUAGE_CODE: 'en-us'
# email config
INSIGHTS_EMAIL_HOST: 'smtp.example.com'
INSIGHTS_EMAIL_HOST_PASSWORD: "mail_password"
INSIGHTS_EMAIL_HOST_USER: "mail_user"
INSIGHTS_EMAIL_PORT: 587
INSIGHTS_ENABLE_AUTO_AUTH: false
INSIGHTS_SEGMENT_IGNORE_EMAIL_REGEX: !!null
INSIGHTS_THEME_SCSS: 'sass/themes/open-edx.scss'
INSIGHTS_RESEARCH_URL: 'https://www.edx.org/research-pedagogy'
INSIGHTS_OPEN_SOURCE_URL: 'http://set-me-please'
INSIGHTS_DOMAIN: 'insights'
# Comma-delimited list of field names to include in the Learner List CSV download
# e.g., "username,segments,cohort,engagements.videos_viewed,last_updated"
# Default (null) includes all available fields, in alphabetical order
INSIGHTS_LEARNER_API_LIST_DOWNLOAD_FIELDS: !!null
INSIGHTS_DATABASE_NAME: 'dashboard'
INSIGHTS_DATABASE_USER: rosencrantz
INSIGHTS_DATABASE_PASSWORD: secret
INSIGHTS_DATABASE_HOST: 127.0.0.1
INSIGHTS_DATABASE_PORT: 3306
INSIGHTS_MYSQL_OPTIONS:
connect_timeout: 10
init_command: "SET sql_mode='STRICT_TRANS_TABLES'"
INSIGHTS_DATABASES:
# rw user
default:
ENGINE: 'django.db.backends.mysql'
NAME: '{{ INSIGHTS_DATABASE_NAME }}'
USER: '{{ INSIGHTS_DATABASE_USER }}'
PASSWORD: '{{ INSIGHTS_DATABASE_PASSWORD }}'
HOST: "{{ INSIGHTS_DATABASE_HOST }}"
PORT: '{{ INSIGHTS_DATABASE_PORT }}'
OPTIONS: "{{ INSIGHTS_MYSQL_OPTIONS }}"
INSIGHTS_LMS_COURSE_SHORTCUT_BASE_URL: "URL_FOR_LMS_COURSE_LIST_PAGE"
INSIGHTS_SESSION_EXPIRE_AT_BROWSER_CLOSE: false
INSIGHTS_CDN_DOMAIN: !!null
INSIGHTS_CORS_ORIGIN_WHITELIST_EXTRA: []
INSIGHTS_CORS_ORIGIN_WHITELIST_DEFAULT:
- "{{ INSIGHTS_DOMAIN }}"
INSIGHTS_CORS_ORIGIN_WHITELIST: "{{ INSIGHTS_CORS_ORIGIN_WHITELIST_DEFAULT + INSIGHTS_CORS_ORIGIN_WHITELIST_EXTRA }}"
# Remote config
INSIGHTS_HERMES_ENABLED: "{{ COMMON_HERMES_ENABLED }}"
INSIGHTS_DECRYPT_CONFIG_ENABLED: "{{ COMMON_DECRYPT_CONFIG_ENABLED }}"
INSIGHTS_COPY_CONFIG_ENABLED: "{{ COMMON_COPY_CONFIG_ENABLED }}"
INSIGHTS_ENABLE_ADMIN_URLS_RESTRICTION: false
#
# This block of config is dropped into /edx/etc/insights.yml
# and is read in by analytics_dashboard/settings/production.py
INSIGHTS_CONFIG:
SUPPORT_EMAIL: '{{ INSIGHTS_SUPPORT_EMAIL }}'
DOCUMENTATION_LOAD_ERROR_URL: '{{ INSIGHTS_DOC_BASE }}/Reference.html#error-conditions'
SEGMENT_IO_KEY: '{{ INSIGHTS_SEGMENT_IO_KEY }}'
SEGMENT_IGNORE_EMAIL_REGEX: '{{ INSIGHTS_SEGMENT_IGNORE_EMAIL_REGEX }}'
PRIVACY_POLICY_URL: '{{ INSIGHTS_PRIVACY_POLICY_URL }}'
TERMS_OF_SERVICE_URL: '{{ INSIGHTS_TERMS_OF_SERVICE_URL }}'
HELP_URL: '{{ INSIGHTS_DOC_BASE }}'
SECRET_KEY: '{{ INSIGHTS_SECRET_KEY }}'
DATA_API_URL: '{{ ANALYTICS_API_ENDPOINT }}'
DATA_API_AUTH_TOKEN: '{{ INSIGHTS_DATA_API_AUTH_TOKEN }}'
SOCIAL_AUTH_REDIRECT_IS_HTTPS: '{{ INSIGHTS_SOCIAL_AUTH_REDIRECT_IS_HTTPS }}'
# Used to automatically configure OAuth2 Client
SOCIAL_AUTH_EDX_OAUTH2_KEY: '{{ INSIGHTS_SOCIAL_AUTH_EDX_OAUTH2_KEY }}'
SOCIAL_AUTH_EDX_OAUTH2_SECRET: '{{ INSIGHTS_SOCIAL_AUTH_EDX_OAUTH2_SECRET }}'
SOCIAL_AUTH_EDX_OAUTH2_ISSUER: '{{ INSIGHTS_LMS_BASE }}'
SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT: '{{ INSIGHTS_LMS_BASE }}'
SOCIAL_AUTH_EDX_OAUTH2_LOGOUT_URL: '{{ INSIGHTS_OAUTH2_URL_LOGOUT }}'
BACKEND_SERVICE_EDX_OAUTH2_KEY: '{{ INSIGHTS_BACKEND_SERVICE_EDX_OAUTH2_KEY }}'
BACKEND_SERVICE_EDX_OAUTH2_SECRET: '{{ INSIGHTS_BACKEND_SERVICE_EDX_OAUTH2_SECRET }}'
BACKEND_SERVICE_EDX_OAUTH2_PROVIDER_URL: '{{ INSIGHTS_OAUTH2_URL_ROOT }}'
ENABLE_AUTO_AUTH: '{{ INSIGHTS_ENABLE_AUTO_AUTH }}'
PLATFORM_NAME: '{{ INSIGHTS_PLATFORM_NAME }}'
APPLICATION_NAME: '{{ INSIGHTS_APPLICATION_NAME }}'
CACHES:
default: &default_generic_cache
BACKEND: 'django.core.cache.backends.memcached.MemcachedCache'
KEY_PREFIX: '{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-insights'
LOCATION: "{{ INSIGHTS_MEMCACHE }}"
TIME_ZONE: '{{ INSIGHTS_TIME_ZONE }}'
LANGUAGE_CODE: '{{ INSIGHTS_LANGUAGE_CODE }}'
# email config
EMAIL_HOST: '{{ INSIGHTS_EMAIL_HOST }}'
EMAIL_HOST_PASSWORD: '{{ INSIGHTS_EMAIL_HOST_PASSWORD }}'
EMAIL_HOST_USER: '{{ INSIGHTS_EMAIL_HOST_USER }}'
EMAIL_PORT: '{{ INSIGHTS_EMAIL_PORT }}'
# static file config
STATICFILES_DIRS: ["{{ insights_static_path }}"]
STATIC_ROOT: "{{ COMMON_DATA_DIR }}/{{ insights_service_name }}/staticfiles"
RESEARCH_URL: '{{ INSIGHTS_RESEARCH_URL }}'
OPEN_SOURCE_URL: '{{ INSIGHTS_OPEN_SOURCE_URL }}'
# db config
DATABASES: "{{ INSIGHTS_DATABASES }}"
LMS_COURSE_SHORTCUT_BASE_URL: "{{ INSIGHTS_LMS_COURSE_SHORTCUT_BASE_URL }}"
COURSE_API_URL: "{{ INSIGHTS_COURSE_API_URL }}"
GRADING_POLICY_API_URL: "{{ INSIGHTS_GRADING_POLICY_API_URL }}"
MODULE_PREVIEW_URL: "{{ INSIGHTS_MODULE_PREVIEW_URL }}"
# When insights is co-located with other django services, we need to ensure they don't all
# use the same cookie names.
SESSION_COOKIE_NAME: "{{ INSIGHTS_SESSION_COOKIE_NAME | default('insights_sessionid') }}"
CSRF_COOKIE_NAME: "{{ INSIGHTS_CSRF_COOKIE_NAME | default('insights_csrftoken') }}"
LANGUAGE_COOKIE_NAME: "{{ INSIGHTS_LANGUAGE_COOKIE_NAME | default('insights_language') }}"
SESSION_EXPIRE_AT_BROWSER_CLOSE: "{{ INSIGHTS_SESSION_EXPIRE_AT_BROWSER_CLOSE }}"
CMS_COURSE_SHORTCUT_BASE_URL: "{{ INSIGHTS_CMS_COURSE_SHORTCUT_BASE_URL }}"
LEARNER_API_LIST_DOWNLOAD_FIELDS: "{{ INSIGHTS_LEARNER_API_LIST_DOWNLOAD_FIELDS }}"
# CDN url to serve assets from
CDN_DOMAIN: "{{ INSIGHTS_CDN_DOMAIN }}"
CSRF_COOKIE_SECURE: "{{ INSIGHTS_CSRF_COOKIE_SECURE }}"
INSIGHTS_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-analytics-api"
INSIGHTS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false
INSIGHTS_PIP_EXTRA_ARGS: "-i {{ COMMON_PYPI_MIRROR_URL }}"
INSIGHTS_NGINX_PORT: "18110"
INSIGHTS_NGINX_SSL_PORT: "18113"
INSIGHTS_GUNICORN_WORKERS: "2"
INSIGHTS_GUNICORN_EXTRA: ""
INSIGHTS_COURSE_API_URL: "{{ INSIGHTS_LMS_BASE }}/api/courses/v1/"
INSIGHTS_GRADING_POLICY_API_URL: "{{ INSIGHTS_LMS_BASE }}/api/grades/v1/"
INSIGHTS_MODULE_PREVIEW_URL: "{{ INSIGHTS_LMS_BASE }}/xblock"
INSIGHTS_VERSION: "master"
INSIGHTS_GIT_IDENTITY: !!null
INSIGHTS_REPOS:
- PROTOCOL: "{{ COMMON_GIT_PROTOCOL }}"
DOMAIN: "{{ COMMON_GIT_MIRROR }}"
PATH: "{{ COMMON_GIT_PATH }}"
REPO: edx-analytics-dashboard.git
VERSION: "{{ INSIGHTS_VERSION }}"
DESTINATION: "{{ insights_code_dir }}"
SSH_KEY: "{{ INSIGHTS_GIT_IDENTITY }}"
INSIGHTS_CSRF_COOKIE_SECURE: false
#
# vars are namespace with the module name.
#
insights_environment:
DJANGO_SETTINGS_MODULE: "analytics_dashboard.settings.production"
ANALYTICS_DASHBOARD_CFG: "{{ COMMON_CFG_DIR }}/{{ insights_service_name }}.yml"
PATH: "{{ insights_nodeenv_bin }}:{{ insights_venv_dir }}/bin:{{ ansible_env.PATH }}"
THEME_SCSS: '{{ INSIGHTS_THEME_SCSS }}'
insights_service_name: insights
insights_venv_dir: "{{ insights_home }}/venvs/{{ insights_service_name }}"
insights_user: "{{ insights_service_name }}"
insights_app_dir: "{{ COMMON_APP_DIR }}/{{ insights_service_name }}"
insights_home: "{{ COMMON_APP_DIR }}/{{ insights_service_name }}"
insights_code_dir: "{{ insights_app_dir }}/edx_analytics_dashboard"
insights_python_path: "{{ insights_code_dir }}/analytics_dashboard"
insights_static_path: "{{ insights_code_dir }}/analytics_dashboard/static"
insights_conf_dir: "{{ insights_home }}"
insights_log_dir: "{{ COMMON_LOG_DIR }}/{{ insights_service_name }}"
insights_nodeenv_dir: "{{ insights_home }}/nodeenvs/{{ insights_service_name }}"
insights_nodeenv_bin: "{{ insights_nodeenv_dir }}/bin"
insights_node_modules_dir: "{{ insights_code_dir }}/node_modules"
insights_node_bin: "{{ insights_node_modules_dir }}/.bin"
INSIGHTS_NODE_VERSION: "16.14.0"
INSIGHTS_NPM_VERSION: "8.5.5"
insights_gunicorn_host: "127.0.0.1"
insights_gunicorn_port: "8110"
insights_gunicorn_timeout: "300"
insights_wsgi: "analytics_dashboard.wsgi:application"
insights_django_settings: "analytics_dashboard.settings.production"
insights_manage: "{{ insights_code_dir }}/manage.py"
insights_requirements_base: "{{ insights_code_dir }}/requirements"
insights_requirements:
- production.txt
- optional.txt
# flag to run Insights on Python 3.8
INSIGHTS_USE_PYTHON38: true
#
# OS packages
#
insights_debian_pkgs:
- libmysqlclient-dev
- libssl-dev # needed for mysqlclient python library
- build-essential
- gettext
- python3-pip
- python3-dev
insights_release_specific_debian_pkgs:
xenial:
- openjdk-8-jdk
bionic:
- openjdk-8-jdk
focal:
- openjdk-8-jdk