forked from openedx-unsupported/configuration
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.yml
322 lines (264 loc) · 13.5 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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
---
#
# 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 ecommerce
#
ECOMMERCE_GIT_IDENTITY: !!null
ECOMMERCE_REPOS:
- PROTOCOL: "{{ COMMON_GIT_PROTOCOL }}"
DOMAIN: "{{ COMMON_GIT_MIRROR }}"
PATH: "{{ COMMON_GIT_PATH }}"
REPO: "ecommerce.git"
VERSION: "{{ ECOMMERCE_VERSION }}"
DESTINATION: "{{ ecommerce_code_dir }}"
SSH_KEY: "{{ ECOMMERCE_GIT_IDENTITY }}"
# 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_SSL_NGINX_PORT: 48130
ECOMMERCE_MEMCACHE:
- localhost:11211
ECOMMERCE_DATABASE_NAME: ecommerce
ECOMMERCE_DATABASE_USER: ecomm001
ECOMMERCE_DATABASE_PASSWORD: password
ECOMMERCE_DATABASE_HOST: localhost
ECOMMERCE_VERSION: "master"
ECOMMERCE_DJANGO_SETTINGS_MODULE: "ecommerce.settings.production"
ECOMMERCE_SESSION_EXPIRE_AT_BROWSER_CLOSE: false
ECOMMERCE_SECRET_KEY: 'Your secret key here'
ECOMMERCE_LANGUAGE_CODE: 'en'
ECOMMERCE_LANGUAGE_COOKIE_NAME: 'openedx-language-preference'
ECOMMERCE_EDX_API_KEY: 'PUT_YOUR_API_KEY_HERE' # This should match the value set for edxapp
ECOMMERCE_ECOMMERCE_URL_ROOT: 'http://localhost:8002'
ECOMMERCE_LOGOUT_URL: '{{ ECOMMERCE_ECOMMERCE_URL_ROOT }}/logout/'
ECOMMERCE_LMS_URL_ROOT: 'http://127.0.0.1:8000'
ECOMMERCE_JWT_ALGORITHM: 'HS256'
ECOMMERCE_JWT_VERIFY_EXPIRATION: true
ECOMMERCE_JWT_DECODE_HANDLER: 'ecommerce.extensions.api.handlers.jwt_decode_handler'
ECOMMERCE_JWT_ISSUERS:
- ISSUER: "{{ COMMON_JWT_ISSUER }}"
AUDIENCE: "{{ COMMON_JWT_AUDIENCE }}"
SECRET_KEY: "{{ COMMON_JWT_SECRET_KEY }}"
- ISSUER: 'ecommerce_worker' # Must match the value of JWT_ISSUER configured for the ecommerce worker.
AUDIENCE: "{{ COMMON_JWT_AUDIENCE }}"
SECRET_KEY: "{{ COMMON_JWT_SECRET_KEY }}"
ECOMMERCE_JWT_LEEWAY: 1
ECOMMERCE_ENROLLMENT_FULFILLMENT_TIMEOUT: 7
ECOMMERCE_LOGGING_ROOT_OVERRIDES: {}
ECOMMERCE_LOGGING_SUBSECTION_OVERRIDES: {}
# Needed to link to the payment micro-frontend.
ECOMMERCE_PAYMENT_MICROFRONTEND_URL: !!null
# Sailthru
ECOMMERCE_SAILTHRU_KEY: 'sailthru key here'
ECOMMERCE_SAILTHRU_SECRET: 'sailthru secret here'
# Used to automatically configure OAuth2 Client
ECOMMERCE_SOCIAL_AUTH_EDX_OAUTH2_KEY: 'ecommerce-sso-key'
ECOMMERCE_SOCIAL_AUTH_EDX_OAUTH2_SECRET: 'ecommerce-sso-secret'
ECOMMERCE_BACKEND_SERVICE_EDX_OAUTH2_KEY: 'ecommerce-backend-service-key'
ECOMMERCE_BACKEND_SERVICE_EDX_OAUTH2_SECRET: 'ecommerce-backend-service-secret'
ECOMMERCE_SOCIAL_AUTH_REDIRECT_IS_HTTPS: false
# NOTE: Deprecate these OIDC settings post-DOP-removal for ecommerce.
ECOMMERCE_SOCIAL_AUTH_EDX_OIDC_KEY: 'ecommerce-key'
ECOMMERCE_SOCIAL_AUTH_EDX_OIDC_SECRET: 'ecommerce-secret'
# Settings for affiliate cookie tracking
ECOMMERCE_AFFILIATE_COOKIE_NAME: '{{ EDXAPP_AFFILIATE_COOKIE_NAME | default("dev_affiliate_id") }}'
ECOMMERCE_OSCAR_FROM_EMAIL: 'oscar@example.com'
# NOTE: The contents of the certificates should be set in private configuration
ecommerce_apple_pay_merchant_certificate_directory: '/edx/etc/ssl'
ecommerce_apple_pay_merchant_certificate_filename: 'apple_pay_merchant.pem'
ecommerce_apple_pay_merchant_certificate_path: '{{ ecommerce_apple_pay_merchant_certificate_directory }}/{{ ecommerce_apple_pay_merchant_certificate_filename }}'
ECOMMERCE_APPLE_PAY_MERCHANT_CERTIFICATE: |
Your PEM file, containing a public and private key,
should be set in private configuration. This is how you
implement a multi-line string in YAML.
ECOMMERCE_APPLE_PAY_MERCHANT_ID_DOMAIN_ASSOCIATION: |
This value should also be in private configuration. It, too,
will span multiple lines.
ECOMMERCE_APPLE_PAY_MERCHANT_IDENTIFIER: 'merchant.com.example'
ECOMMERCE_APPLE_PAY_COUNTRY_CODE: 'US'
# CyberSource related
ECOMMERCE_CYBERSOURCE_PROFILE_ID: 'SET-ME-PLEASE'
ECOMMERCE_CYBERSOURCE_MERCHANT_ID: 'SET-ME-PLEASE'
ECOMMERCE_CYBERSOURCE_ACCESS_KEY: 'SET-ME-PLEASE'
ECOMMERCE_CYBERSOURCE_SECRET_KEY: 'SET-ME-PLEASE'
ECOMMERCE_CYBERSOURCE_SOP_ACCESS_KEY: 'SET-ME-PLEASE'
ECOMMERCE_CYBERSOURCE_SOP_PROFILE_ID: 'SET-ME-PLEASE'
ECOMMERCE_CYBERSOURCE_SOP_SECRET_KEY: 'SET-ME-PLEASE'
ECOMMERCE_CYBERSOURCE_SOP_PAYMENT_PAGE_URL: 'https://testsecureacceptance.cybersource.com/silent/pay'
ECOMMERCE_CYBERSOURCE_TRANSACTION_KEY: 'SET-ME-PLEASE'
ECOMMERCE_CYBERSOURCE_PAYMENT_PAGE_URL: 'https://testsecureacceptance.cybersource.com/pay'
ECOMMERCE_CYBERSOURCE_RECEIPT_PAGE_URL: '/checkout/receipt/'
ECOMMERCE_CYBERSOURCE_CANCEL_PAGE_URL: '/checkout/cancel-checkout/'
ECOMMERCE_CYBERSOURCE_SEND_LEVEL_2_3_DETAILS: true
ECOMMERCE_CYBERSOURCE_SOAP_API_URL: 'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.140.wsdl'
# PayPal
ECOMMERCE_PAYPAL_MODE: 'sandbox'
ECOMMERCE_PAYPAL_CLIENT_ID: 'SET-ME-PLEASE'
ECOMMERCE_PAYPAL_CLIENT_SECRET: 'SET-ME-PLEASE'
ECOMMERCE_PAYPAL_RECEIPT_URL: '/checkout/receipt/'
ECOMMERCE_PAYPAL_CANCEL_URL: '/checkout/cancel-checkout/'
ECOMMERCE_PAYPAL_ERROR_URL: '/checkout/error/'
ECOMMERCE_PAYMENT_PROCESSOR_CONFIG:
edx:
cybersource:
merchant_id: '{{ ECOMMERCE_CYBERSOURCE_MERCHANT_ID }}'
profile_id: '{{ ECOMMERCE_CYBERSOURCE_PROFILE_ID }}'
access_key: '{{ ECOMMERCE_CYBERSOURCE_ACCESS_KEY }}'
secret_key: '{{ ECOMMERCE_CYBERSOURCE_SECRET_KEY }}'
transaction_key: '{{ ECOMMERCE_CYBERSOURCE_TRANSACTION_KEY }}'
payment_page_url: '{{ ECOMMERCE_CYBERSOURCE_PAYMENT_PAGE_URL }}'
receipt_page_url: '{{ ECOMMERCE_CYBERSOURCE_RECEIPT_PAGE_URL }}'
cancel_page_url: '{{ ECOMMERCE_CYBERSOURCE_CANCEL_PAGE_URL }}'
soap_api_url: '{{ ECOMMERCE_CYBERSOURCE_SOAP_API_URL }}'
send_level_2_3_details: '{{ ECOMMERCE_CYBERSOURCE_SEND_LEVEL_2_3_DETAILS }}'
sop_profile_id: '{{ ECOMMERCE_CYBERSOURCE_SOP_PROFILE_ID }}'
sop_access_key: '{{ ECOMMERCE_CYBERSOURCE_SOP_ACCESS_KEY }}'
sop_secret_key: '{{ ECOMMERCE_CYBERSOURCE_SOP_SECRET_KEY }}'
sop_payment_page_url: '{{ ECOMMERCE_CYBERSOURCE_SOP_PAYMENT_PAGE_URL }}'
# NOTE: These are simple placeholders meant to show what keys are needed for Apple Pay. These values
# should be overwritten in private configuration.
apple_pay_merchant_identifier: '{{ ECOMMERCE_APPLE_PAY_MERCHANT_IDENTIFIER }}'
apple_pay_merchant_id_domain_association: '{{ ECOMMERCE_APPLE_PAY_MERCHANT_ID_DOMAIN_ASSOCIATION }}'
apple_pay_merchant_id_certificate_path: '{{ ecommerce_apple_pay_merchant_certificate_path }}'
apple_pay_country_code: '{{ ECOMMERCE_APPLE_PAY_COUNTRY_CODE }}'
paypal:
mode: '{{ ECOMMERCE_PAYPAL_MODE }}'
client_id: '{{ ECOMMERCE_PAYPAL_CLIENT_ID }}'
client_secret: '{{ ECOMMERCE_PAYPAL_CLIENT_SECRET }}'
receipt_url: '{{ ECOMMERCE_PAYPAL_RECEIPT_URL }}'
cancel_checkout_path: '{{ ECOMMERCE_PAYPAL_CANCEL_URL }}'
error_url: '{{ ECOMMERCE_PAYPAL_ERROR_URL }}'
# JWT payload user attribute mapping
ECOMMERCE_EDX_DRF_EXTENSIONS:
JWT_PAYLOAD_USER_ATTRIBUTE_MAPPING:
administrator: 'is_staff'
email: 'email'
full_name: 'full_name'
tracking_context: 'tracking_context'
user_id: 'lms_user_id'
JWT_PAYLOAD_MERGEABLE_USER_ATTRIBUTES:
- 'tracking_context'
OAUTH2_USER_INFO_URL: '{{ edx_django_service_oidc_url_root }}/user_info'
# Theming
ECOMMERCE_PLATFORM_NAME: 'Your Platform Name Here'
ECOMMERCE_THEME_SCSS: 'sass/themes/default.scss'
ECOMMERCE_COMPREHENSIVE_THEME_DIRS:
- '{{ THEMES_CODE_DIR }}/{{ ecommerce_service_name }}'
- '{{ COMMON_APP_DIR }}/{{ ecommerce_service_name }}/{{ ecommerce_service_name }}/ecommerce/themes'
ECOMMERCE_ENABLE_COMPREHENSIVE_THEMING: false
ECOMMERCE_DEFAULT_SITE_THEME: !!null
ECOMMERCE_STATICFILES_STORAGE: 'ecommerce.theming.storage.ThemeStorage'
# Celery
ECOMMERCE_BROKER_USERNAME: 'celery'
ECOMMERCE_BROKER_PASSWORD: 'celery'
ECOMMERCE_BROKER_HOST: '{{ ansible_default_ipv4.address }}'
ECOMMERCE_BROKER_PORT: 5672
ECOMMERCE_BROKER_TRANSPORT: 'amqp'
ECOMMERCE_BROKER_URL: '{{ ECOMMERCE_BROKER_TRANSPORT }}://{{ ECOMMERCE_BROKER_USERNAME }}:{{ ECOMMERCE_BROKER_PASSWORD }}@{{ ECOMMERCE_BROKER_HOST }}:{{ ECOMMERCE_BROKER_PORT }}'
ECOMMERCE_DISCOVERY_SERVICE_URL: 'http://localhost:8008'
ECOMMERCE_ENTERPRISE_URL: '{{ ECOMMERCE_LMS_URL_ROOT }}'
ECOMMERCE_CORS_ORIGIN_WHITELIST: []
ECOMMERCE_CORS_URLS_REGEX: ''
ECOMMERCE_CORS_ALLOW_CREDENTIALS: false
ECOMMERCE_USERNAME_REPLACEMENT_WORKER: "OVERRIDE THIS WITH A VALID USERNAME"
ecommerce_service_config_overrides:
LANGUAGE_COOKIE_NAME: '{{ ECOMMERCE_LANGUAGE_COOKIE_NAME }}'
EDX_API_KEY: '{{ ECOMMERCE_EDX_API_KEY }}'
OSCAR_FROM_EMAIL: '{{ ECOMMERCE_OSCAR_FROM_EMAIL }}'
ENTERPRISE_SERVICE_URL: '{{ ECOMMERCE_ENTERPRISE_URL }}/enterprise/'
ECOMMERCE_URL_ROOT: '{{ ECOMMERCE_ECOMMERCE_URL_ROOT }}'
# TODO LEARNER-3041: Update this service and ecomworker to only use the central JWT access token issuer
JWT_AUTH:
JWT_SECRET_KEY: '{{ COMMON_JWT_SECRET_KEY }}'
JWT_ALGORITHM: '{{ ECOMMERCE_JWT_ALGORITHM }}'
JWT_VERIFY_EXPIRATION: '{{ ECOMMERCE_JWT_VERIFY_EXPIRATION }}'
JWT_LEEWAY: '{{ ECOMMERCE_JWT_LEEWAY }}'
JWT_DECODE_HANDLER: '{{ ECOMMERCE_JWT_DECODE_HANDLER }}'
JWT_ISSUERS: '{{ ECOMMERCE_JWT_ISSUERS }}'
JWT_PUBLIC_SIGNING_JWK_SET: '{{ COMMON_JWT_PUBLIC_SIGNING_JWK_SET }}'
JWT_AUTH_COOKIE_HEADER_PAYLOAD: '{{ COMMON_JWT_AUTH_COOKIE_HEADER_PAYLOAD }}'
JWT_AUTH_COOKIE_SIGNATURE: '{{ COMMON_JWT_AUTH_COOKIE_SIGNATURE }}'
JWT_AUTH_REFRESH_COOKIE: '{{ COMMON_JWT_AUTH_REFRESH_COOKIE }}'
EDX_DRF_EXTENSIONS: '{{ ECOMMERCE_EDX_DRF_EXTENSIONS }}'
AFFILIATE_COOKIE_KEY: '{{ ECOMMERCE_AFFILIATE_COOKIE_NAME }}'
PAYMENT_PROCESSOR_CONFIG: '{{ ECOMMERCE_PAYMENT_PROCESSOR_CONFIG }}'
PLATFORM_NAME: '{{ ECOMMERCE_PLATFORM_NAME }}'
THEME_SCSS: '{{ ECOMMERCE_THEME_SCSS }}'
BROKER_URL: '{{ ECOMMERCE_BROKER_URL }}'
SAILTHRU_KEY: '{{ ECOMMERCE_SAILTHRU_KEY }}'
SAILTHRU_SECRET: '{{ ECOMMERCE_SAILTHRU_SECRET }}'
# Theming config
COMPREHENSIVE_THEME_DIRS: "{{ ECOMMERCE_COMPREHENSIVE_THEME_DIRS }}"
ENABLE_COMPREHENSIVE_THEMING: "{{ ECOMMERCE_ENABLE_COMPREHENSIVE_THEMING }}"
DEFAULT_SITE_THEME: "{{ ECOMMERCE_DEFAULT_SITE_THEME }}"
CSRF_COOKIE_SECURE: "{{ ECOMMERCE_CSRF_COOKIE_SECURE }}"
SESSION_COOKIE_SECURE: '{{ ECOMMERCE_SESSION_COOKIE_SECURE}}'
CORS_ORIGIN_WHITELIST: "{{ ECOMMERCE_CORS_ORIGIN_WHITELIST }}"
CORS_URLS_REGEX: "{{ ECOMMERCE_CORS_URLS_REGEX }}"
CORS_ALLOW_CREDENTIALS: "{{ ECOMMERCE_CORS_ALLOW_CREDENTIALS }}"
USERNAME_REPLACEMENT_WORKER: "{{ ECOMMERCE_USERNAME_REPLACEMENT_WORKER }}"
PAYMENT_MICROFRONTEND_URL: "{{ ECOMMERCE_PAYMENT_MICROFRONTEND_URL}}"
ENROLLMENT_FULFILLMENT_TIMEOUT: "{{ ECOMMERCE_ENROLLMENT_FULFILLMENT_TIMEOUT }}"
LOGGING_ROOT_OVERRIDES: "{{ ECOMMERCE_LOGGING_ROOT_OVERRIDES }}"
LOGGING_SUBSECTION_OVERRIDES: "{{ ECOMMERCE_LOGGING_SUBSECTION_OVERRIDES }}"
ECOMMERCE_GUNICORN_WORKER_CLASS: "sync"
ECOMMERCE_GUNICORN_MAX_REQUESTS: 3000
ECOMMERCE_GUNICORN_EXTRA: ""
ECOMMERCE_GUNICORN_WORKERS: 2
ECOMMERCE_CSRF_COOKIE_SECURE: false
ECOMMERCE_SESSION_COOKIE_SECURE: true
# See edx_django_service_automated_users for an example of what this should be
ECOMMERCE_AUTOMATED_USERS: {}
# Remote config
ECOMMERCE_HERMES_ENABLED: "{{ COMMON_HERMES_ENABLED }}"
ECOMMERCE_DECRYPT_CONFIG_ENABLED: "{{ COMMON_DECRYPT_CONFIG_ENABLED }}"
ECOMMERCE_COPY_CONFIG_ENABLED: "{{ COMMON_COPY_CONFIG_ENABLED }}"
#
# vars are namespace with the module name.
#
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_venv_dir: "{{ ecommerce_home }}/venvs/{{ ecommerce_service_name }}"
ecommerce_gunicorn_port: "8130"
ecommerce_environment:
ECOMMERCE_CFG: "{{ COMMON_CFG_DIR }}/{{ ecommerce_service_name }}.yml"
ecommerce_create_demo_data: false
# Antivirus
ECOMMERCE_ENABLE_ANTIVIRUS: false
ECOMMERCE_ANTIVIRUS_SCAN_DIRECTORY: "{{ ecommerce_code_dir }}"
ECOMMERCE_ENABLE_ADMIN_URLS_RESTRICTION: false
ECOMMERCE_ADMIN_URLS:
- admin
ECOMMERCE_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false
# Python 3 conversion
ECOMMERCE_USE_PYTHON3: false
#
# OS packages
#
ecommerce_debian_pkgs:
- libmysqlclient-dev
- libjpeg-dev
- libssl-dev
- libffi-dev
- libsqlite3-dev
- python-dev
- python3-dev
ecommerce_redhat_pkgs: []
ecommerce_post_migrate_commands:
- command: './manage.py oscar_populate_countries --initial-only'
when: true
- command: './manage.py create_or_update_site --site-id=1 --site-domain={{ ECOMMERCE_ECOMMERCE_URL_ROOT.split("://")[1] }} --partner-code=edX --partner-name="Open edX" --lms-url-root={{ ECOMMERCE_LMS_URL_ROOT }} --client-side-payment-processor=cybersource --payment-processors=cybersource,paypal --client-id={{ ECOMMERCE_SOCIAL_AUTH_EDX_OIDC_KEY }} --client-secret={{ ECOMMERCE_SOCIAL_AUTH_EDX_OIDC_SECRET }} --sso-client-id={{ ECOMMERCE_SOCIAL_AUTH_EDX_OAUTH2_KEY }} --sso-client-secret={{ ECOMMERCE_SOCIAL_AUTH_EDX_OAUTH2_SECRET }} --backend-service-client-id={{ ECOMMERCE_BACKEND_SERVICE_EDX_OAUTH2_KEY }} --backend-service-client-secret={{ ECOMMERCE_BACKEND_SERVICE_EDX_OAUTH2_SECRET }} --from-email staff@example.com --discovery_api_url={{ ECOMMERCE_DISCOVERY_SERVICE_URL }}/api/v1/'
when: '{{ ecommerce_create_demo_data }}'
- command: './manage.py create_demo_data --partner=edX'
when: '{{ ecommerce_create_demo_data }}'