- Replace Jinja2 template (script.py.j2) with raw Python script (files/script.py) - Add argparse options: --manipulation, --manipulation-string, --timeout - Implement timeout handling in wait_while_manipulation_running - Update systemd ExecStart/ExecStartPre handling in tasks/01_core.yml - Remove obsolete systemctl.service.j2 and script.py.j2 templates - Add unittest suite under tests/unit/roles/sys-ctl-rpr-docker-soft/files/test_script.py - Mock docker and systemctl calls in tests for safe execution Reference: ChatGPT conversation (see https://chatgpt.com/share/68ad770b-ea84-800f-b378-559cb61fc43a)
Docker Healer 🩺
Description
This Ansible role automatically restarts Docker Compose configurations with exited or unhealthy containers on Arch Linux systems. It ensures the stability of containerized workloads by recovering from common error conditions like port binding issues.
Overview
Tailored for Arch Linux, this role monitors containers for failure states and initiates a controlled restart of affected Compose configurations. If port conflicts prevent recovery, the role stops the affected stack, restarts Docker, and recreates the container environment.
Purpose
The purpose of this role is to provide automated healing for Docker Compose environments, minimizing manual recovery effort and reducing downtime.
Features
- Container Health Monitoring: Detects unhealthy or exited containers.
- Automated Recovery: Restarts failed containers and resolves port binding issues.
- Run-once Setup Logic: Ensures idempotent execution by controlling task flow with internal flags.
- System Role Integration: Seamlessly integrates with Infinito.Nexus system maintenance logic.
Credits 📝
Developed and maintained by Kevin Veen-Birkenbach.
Learn more at www.veen.world
Part of the Infinito.Nexus Project
License: Infinito.Nexus NonCommercial License