Files
computer-playbook/roles/web-app-moodle/tasks/main.yml
Kevin Veen-Birkenbach 6ea8301364 Refactor: migrate cmp/* and srv/* roles into sys-stk/* and sys-svc/* namespaces
- Removed obsolete 'cmp' category, introduced 'stk' category (fa-bars-staggered icon).
- Renamed roles:
  * cmp-db-docker → sys-stk-back-stateful
  * cmp-docker-oauth2 → sys-stk-back-stateless
  * srv-domain-provision → sys-stk-front
  * cmp-db-docker-proxy → sys-stk-full-stateful
  * cmp-docker-proxy → sys-stk-full-stateless
  * cmp-rdbms → sys-svc-rdbms
- Updated all include_role references, vars, templates and README.md files.
- Adjusted run_once comments and variable paths accordingly.
- Updated all web-app roles to use new sys-stk/* and sys-svc/* roles.

Conversation: https://chatgpt.com/share/68b0ba66-09f8-800f-86fc-76c47009d431
2025-08-28 22:23:09 +02:00

49 lines
1.5 KiB
YAML

---
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: sys-stk-full-stateful
- name: Check if config.php exists
command: docker exec --user root {{ moodle_container }} test -f {{ moodle_config }}
register: config_file_exists
changed_when: false
failed_when: false
- name: Check if config.php exists
command: docker exec --user root {{ moodle_container }} test -f {{ moodle_config }}
register: config_file_exists
changed_when: false
failed_when: false
- name: "Update database credentials"
include_tasks: 01_patch_config.yml
when: config_file_exists.rc == 0
- name: flush docker service
meta: flush_handlers
- name: Wait until the Moodle container is healthy
shell: docker inspect --format '{% raw %}{{.State.Health.Status}}{% endraw %}' {{ moodle_container }}
register: health_check
until: health_check.stdout.strip() == "healthy"
retries: 120
delay: 5
- name: "Include ownership settings tasks for moodle"
include_tasks: 02_ownership.yml
- name: "Configure OIDC login for Moodle if enabled"
include_tasks: 03_oidc.yml
when: applications | get_app_conf(application_id, 'features.oidc', False)
# Deactivated because it doesn't give helpfull warnings back
#- name: Run Moodle system check
# command: >
# docker exec --user {{ bitnami_user }} {{ moodle_container }}
# php /opt/bitnami/moodle/admin/cli/checks.php
# register: moodle_checks
# changed_when: false
# failed_when: >
# moodle_checks.rc != 0 or
# "OK: All" not in moodle_checks.stdout