diff --git a/roles/web-app-moodle/tasks/04_oidc.yml b/roles/web-app-moodle/tasks/04_oidc.yml index e150b4d5ed..7870731012 100644 --- a/roles/web-app-moodle/tasks/04_oidc.yml +++ b/roles/web-app-moodle/tasks/04_oidc.yml @@ -93,7 +93,6 @@ - { name: "field_map_lastnamephonetic", value: "name_phonetic_family" } - { name: "field_lock_lastnamephonetic", value: "locked" } - { name: "field_updatelocal_lastnamephonetic", value: "oneveryloginupdate" } - - { name: "alternateloginurl", value: "{{ lookup('tls', application_id, 'url.base') }}{{ MOODLE_OIDC_PLUGIN_RELPATH }}/" } loop_control: label: "{{ item.name }}" shell: > @@ -102,6 +101,20 @@ --name={{ item.name }} --set="{{ item.value }}" changed_when: false +- name: "🟢 Enable the auth_oidc plugin in Moodle's core auth list" + shell: > + container exec --user {{ MOODLE_RUNTIME_USER }} {{ MOODLE_CONTAINER_ADDRESS }} + php {{ MOODLE_CLI_DIR }}/cfg.php --name=auth --set=oidc + changed_when: false + +- name: "🔀 Point the Moodle login page at the auth_oidc entry point" + shell: > + container exec --user {{ MOODLE_RUNTIME_USER }} {{ MOODLE_CONTAINER_ADDRESS }} + php {{ MOODLE_CLI_DIR }}/cfg.php + --name=alternateloginurl + --set={{ (lookup('tls', application_id, 'url.base') ~ MOODLE_OIDC_PLUGIN_RELPATH ~ '/') | quote }} + changed_when: false + - name: "🔧 Set auth = 'oidc' for all users except guest" shell: > container exec {{ MOODLE_DB_CONTAINER_ADDRESS }}