Skip to content

Commit 457f823

Browse files
Douglas HallDouglas Hall
Douglas Hall
authored and
Douglas Hall
committed
Revert "Revert "[asadiqbal08/ENT-322] Add 'enterprise_worker' user to LMS user provisioning""
1 parent 9730dd3 commit 457f823

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
- Role: edxapp
2+
- Added creation of enterprise_worker user to provisioning. This user is used by the edx-enterprise package when making API requests to Open edX IDAs.
3+
14
- Role: neo4j
25
- Increase heap and page caches sizes for neo4j
36

playbooks/roles/common_vars/defaults/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,5 @@ COMMON_JWT_AUDIENCE: 'SET-ME-PLEASE'
221221
COMMON_JWT_ISSUER: '{{ COMMON_OIDC_ISSUER }}'
222222
COMMON_JWT_SECRET_KEY: 'SET-ME-PLEASE'
223223

224+
# Set worker user default
225+
CREATE_SERVICE_WORKER_USERS: True

playbooks/roles/edxapp/defaults/main.yml

+8
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ EDXAPP_BLOCK_STRUCTURES_SETTINGS:
693693
# Configuration settings needed for the LMS to communicate with the Enterprise service.
694694
EDXAPP_ENTERPRISE_API_URL: "{{ EDXAPP_LMS_ROOT_URL }}/enterprise/api/v1"
695695

696+
EDXAPP_ENTERPRISE_SERVICE_WORKER_EMAIL: "[email protected]"
696697
EDXAPP_ENTERPRISE_SERVICE_WORKER_USERNAME: "enterprise_worker"
697698

698699
EDXAPP_ENTERPRISE_COURSE_ENROLLMENT_AUDIT_MODES:
@@ -1304,3 +1305,10 @@ edxapp_cms_variant: cms
13041305

13051306
# Worker Settings
13061307
worker_django_settings_module: '{{ EDXAPP_SETTINGS }}'
1308+
1309+
# Add default service worker users
1310+
SERVICE_WORKER_USERS:
1311+
- email: "{{ EDXAPP_ENTERPRISE_SERVICE_WORKER_EMAIL }}"
1312+
username: "{{ EDXAPP_ENTERPRISE_SERVICE_WORKER_USERNAME }}"
1313+
is_staff: true
1314+
is_superuser: false

playbooks/roles/edxapp/tasks/deploy.yml

+19
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,22 @@
417417
become_user: "{{ common_web_user }}"
418418
tags:
419419
- manage
420+
421+
- name: build service worker users list
422+
set_fact:
423+
service_worker_users: "{{ [SERVICE_WORKER_USERS] }}"
424+
when: CREATE_SERVICE_WORKER_USERS
425+
tags:
426+
- manage
427+
- manage:db
428+
429+
- name: create service worker users
430+
shell: "{{ edxapp_venv_bin }}/python ./manage.py lms --settings={{ edxapp_settings }} --service-variant lms manage_user {{ item.username}} {{ item.email }} --unusable-password {% if item.is_staff %} --staff{% endif %}"
431+
args:
432+
chdir: "{{ edxapp_code_dir }}"
433+
become_user: "{{ common_web_user }}"
434+
with_items: "{{ service_worker_users }}"
435+
when: CREATE_SERVICE_WORKER_USERS
436+
tags:
437+
- manage
438+
- manage:db

0 commit comments

Comments
 (0)