mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-05-18 10:40:33 +02:00
Solved is_feature_enabled bug and implemented Dockerfile for moodle
This commit is contained in:
parent
52ba4dc3a1
commit
8ffb6a9cee
@ -835,7 +835,7 @@
|
||||
"secret": "{{oidc.client.secret}}",
|
||||
{%- set redirect_uris = [] %}
|
||||
{%- for application, domain in domains.items() %}
|
||||
{%- if applications[application] is defined and (applications | is_feature_enabled('oauth2',application) or applications | is_feature_enabled('oidc',application)) %}
|
||||
{%- if applications[application] is defined and (applications | is_feature_enabled('oauth2',application) or applications | is_feature_enabled('oidc',application_id)) %}
|
||||
{%- if domain is string %}
|
||||
{%- set _ = redirect_uris.append(web_protocol ~ '://' ~ domain ~ '/*') %}
|
||||
{%- else %}
|
||||
|
@ -10,9 +10,15 @@
|
||||
domain: "{{ domains[application_id] }}"
|
||||
http_port: "{{ ports.localhost.http[application_id] }}"
|
||||
|
||||
- name: "Transfer Dockerfile to {{ docker_compose.directories.instance }}"
|
||||
copy:
|
||||
src: Dockerfile.j2
|
||||
dest: "{{ docker_compose.directories.instance }}Dockerfile"
|
||||
notify: docker compose project build and setup
|
||||
|
||||
- name: "copy docker-compose.yml and env file"
|
||||
include_tasks: copy-docker-compose-and-env.yml
|
||||
|
||||
- name: "Configure OIDC login for Moodle if enabled"
|
||||
include_tasks: oidc.yml
|
||||
when: applications | is_feature_enabled('oidc',application)
|
||||
when: applications | is_feature_enabled('oidc',application_id)
|
||||
|
@ -1,13 +1,4 @@
|
||||
---
|
||||
- name: "Ensure OIDC plugin is installed inside container"
|
||||
command: >
|
||||
docker exec {{ container_name }} bash -c '
|
||||
set -e;
|
||||
cd /bitnami/moodle;
|
||||
if [ ! -d "auth/oidc" ]; then
|
||||
git clone https://github.com/microsoft/moodle-auth_oidc.git auth/oidc;
|
||||
fi'
|
||||
|
||||
- name: "Upgrade Moodle to apply OIDC plugin"
|
||||
command: "docker exec {{ container_name }} php admin/cli/upgrade.php --non-interactive"
|
||||
|
||||
|
14
roles/docker-moodle/templates/Dockerfile.j2
Normal file
14
roles/docker-moodle/templates/Dockerfile.j2
Normal file
@ -0,0 +1,14 @@
|
||||
FROM bitnami/moodle:{{ applications[application_id].version }}
|
||||
|
||||
{% if applications | is_feature_enabled('oidc',application_id) %}
|
||||
# Install git (required to clone the OIDC plugin)
|
||||
USER root
|
||||
RUN install_packages git unzip
|
||||
|
||||
# Clone the Microsoft OIDC plugin into Moodle's auth directory
|
||||
RUN git clone https://github.com/microsoft/moodle-auth_oidc.git \
|
||||
/opt/bitnami/moodle/auth/oidc && \
|
||||
chown -R www-data:www-data /opt/bitnami/moodle/auth/oidc
|
||||
|
||||
USER 1001
|
||||
{% endif %}
|
@ -3,7 +3,10 @@ services:
|
||||
{% include 'roles/docker-central-database/templates/services/' + database_type + '.yml.j2' %}
|
||||
moodle:
|
||||
container_name: {{ container_name }}
|
||||
image: docker.io/bitnami/moodle:{{applications.moodle.version}}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: moodle_custom
|
||||
ports:
|
||||
- 127.0.0.1:{{ports.localhost.http[application_id]}}:8080
|
||||
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user