computer-playbook/roles/sys-ctl-cln-disc-space
Kevin Veen-Birkenbach efa68cc1e0
sys-ctl: make service file generation deterministic and simplify ignore logic
- Added '| sort' to all service group lists and backup routine lists to ensure
  deterministic ordering and stable checksums across Ansible runs.
- Adjusted systemctl templates to use a single service variable
  ('SYS_SERVICE_BACKUP_RMT_2_LOC') instead of rejecting dynamic list entries,
  making the ignore logic simpler and more predictable.
- Fixed minor whitespace inconsistencies in Jinja templates to avoid
  unnecessary changes.

This change was made to prevent spurious 'changed' states in Ansible caused by
non-deterministic list order and to reduce complexity in service definitions.

See discussion: https://chatgpt.com/share/68a74c20-6300-800f-a44e-da43ae2f3dea
2025-08-21 18:43:17 +02:00
..

Cleanup Disc Space

Description

This role frees disk space by executing a script that cleans up temporary files, clears package caches, and optionally cleans up backup directories and Docker resources when disk usage exceeds a specified threshold.

Overview

Optimized for efficient storage management, this role:

  • Creates a directory for disk cleanup scripts.
  • Deploys a Bash script that frees disk space by cleaning up /tmp, Docker resources, and pacman cache.
  • Configures a systemd service to run the disk cleanup script.
  • Optionally integrates with backup cleanup if backup variables are defined.

Purpose

The primary purpose of this role is to ensure that disk space remains within safe limits by automating cleanup tasks, thereby improving system performance and stability.

Features

  • Automated Cleanup: Executes a script to remove temporary files and clear caches.
  • Threshold-Based Execution: Triggers cleanup when disk usage exceeds a defined percentage.
  • Systemd Integration: Configures a systemd service to manage the disk cleanup process.
  • Docker and Backup Integration: Optionally cleans Docker resources and backups if configured.