Files
computer-playbook/roles/sys-ctl-rpr-docker-hard
Kevin Veen-Birkenbach dd9a9b6d84 feat(mediawiki): Refactor OIDC + debug; install Composer deps in-container; modularize role
Discussion: https://chatgpt.com/share/68b10c0a-c308-800f-93ac-2ffb386cf58b

- Split tasks into 01_install, 02_debug, 03_admin, 04_extensions, 05_oidc.
- Ensure unzip+git+composer on demand in the container; run Composer as www-data with COMPOSER_HOME=/tmp/composer.
- Idempotently unpack/install PluggableAuth & OpenIDConnect; run composer install only if vendor/ is missing.
- Add sanity check for Jumbojett\OpenIDConnectClient.
- Copy oidc.php only when changed and append a single require_once to LocalSettings.php.
- Use REL1_44-compatible numeric array for $wgPluggableAuth_Config; set $wgPluggableAuth_ButtonLabelMessage.
- Debug: add debug.php that logs to STDERR (visible via docker logs); toggle cleanly with MODE_DEBUG.
- Enable OIDC feature in config; add paths/OIDC/extension vars in vars/main.yml.

fix(services): include SYS_SERVICE_GROUP_CLEANUP in StartPre lock (ssd-hdd, docker-hard).

fix(desktop/joomla): simplify MODE_DEBUG templating.

chore: minor cleanups and renames.
2025-08-29 04:10:46 +02:00
..

Docker Auto Restart

Description

This role automates the restart process for Docker Compose instances within a specified directory. It deploys a Python script that checks for the presence of docker-compose.yml files and restarts the associated services—using a hard restart for certain directories if needed.

Overview

Optimized for containerized environments, this role:

  • Sets up the necessary directories and scripts for restarting Docker Compose instances.
  • Configures a systemd service (and optionally a timer) to execute the restart script.
  • Handles both standard restarts and hard restarts for specific containers (e.g., for Mailu).

Purpose

The primary purpose of this role is to ensure that all Docker Compose services are restarted consistently, resolving issues that may arise from partial restarts. This helps maintain overall service stability and minimizes downtime.

Features

  • Automated Detection: Scans a specified parent directory for docker-compose.yml files.
  • Service Restart: Executes a Python script to restart Docker services via docker-compose.
  • Conditional Hard Restart: Applies a hard restart procedure for specific directories (e.g., Mailu).
  • Systemd Integration: Configures a systemd service and optionally a timer for scheduled restarts.

Context

This role was implemented to address the classic issue: "Have you tried turning it off and on again?". The problem initially arose with the fetchmail container in Mailu, which fails if only some containers, and not the full docker-compose composition, are restarted.

Credits 📝

This role was developed with the assistance of ChatGPT, including insights and optimizations from this conversation. Special thanks for providing guidance on error handling, Ansible best practices, and Python integration.