computer-playbook/roles/health-docker-volumes
Kevin Veen-Birkenbach d8f14a9c36 Changed suffix to .cymais.timer 2024-01-10 11:26:00 +01:00
..
files Solved bug 2023-12-29 19:55:26 +01:00
handlers Added .cymais.service suffix to make cymais files more visible 2024-01-10 11:18:38 +01:00
meta Changed systemd-notifier namings 2023-12-03 11:24:17 +01:00
tasks Added .cymais.service suffix to make cymais files more visible 2024-01-10 11:18:38 +01:00
templates Added .cymais.service suffix to make cymais files more visible 2024-01-10 11:18:38 +01:00
vars implemented check for anonymous volumes 2023-11-17 16:53:56 +01:00
README.md Changed suffix to .cymais.timer 2024-01-10 11:26:00 +01:00

README.md

Health Check for Docker Volumes

Description

This role checks for anonymous Docker volumes that are not bound to a container and may be left over from previous operations. It provides a cleanup mechanism by identifying such volumes, excluding any that are whitelisted, and possibly taking action against them.

Files

  • vars/main.yml: Variable definitions for the script's directory and whitelist.
  • handlers/main.yml: Handlers to reload and restart the systemd service and timer.
  • files/health-docker-volumes.sh: The script that checks for anonymous Docker volumes and excludes whitelisted volumes.
  • tasks/main.yml: Tasks to create necessary directories, copy scripts, and create systemd service and timer.
  • templates/health-docker-volumes.cymais.service.j2: Systemd service template, including the whitelisted volumes as a parameter.
  • templates/health-docker-volumes.cymais.timer.j2: Systemd timer template.
  • meta/main.yml: Meta information declaring dependencies for the role.

Usage

Include this role in your playbook and set the path_administrator_scripts variable to determine where the health check scripts should reside. Define whitelisted_anonymous_volumes in vars/main.yml with an array of volume IDs that should be ignored by the health check.

Ensure that the systemd-notifier dependency is satisfied for error notifications.

Created with AI

This script was created with the help of AI. The full conversation you find here.