Sys-ctl-cln-disc-space Role¶
Description: Cleanup routine for reclaiming disk space from temp files, package caches, optional Docker data and old backups
Variables¶
author: Kevin Veen-Birkenbach
description: Cleanup routine for reclaiming disk space from temp files, package caches, optional Docker data and old backups
license: Infinito.Nexus Community License (Non-Commercial)
company: Kevin Veen-Birkenbach https://www.veen.world
min_ansible_version: 2.9
platforms: [{‘name’: ‘ArchLinux’, ‘versions’: [‘all’]}, {‘name’: ‘Debian’, ‘versions’: [‘all’]}, {‘name’: ‘EL’, ‘versions’: [‘all’]}, {‘name’: ‘Fedora’, ‘versions’: [‘all’]}, {‘name’: ‘Ubuntu’, ‘versions’: [‘all’]}]
galaxy_tags: [‘disk’, ‘cleanup’, ‘storage’, ‘automation’]
issue_tracker_url: https://s.infinito.nexus/issues
README¶
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.
Cosmos¶
The diagram places Cleanup Disc Space in the Infinito.Nexus cosmos: the components it deploys (capabilities), the central services it consumes (dependencies), and its outward reach (federation and bridged external networks).
flowchart LR
subgraph role [sys-ctl-cln-disc-space 💻]
svc_disc_space["disc-space"]
endSolid 1:1 edges are fixed relationships; dashed 0..1 edges are
conditional (enabled only in matching deployments); red 0..0 edges
are turned off in this role. Node markers show the role’s deploy modes
(💻 host, 🐳 compose, 🐝 swarm); ❌ marks a service that is explicitly
turned off, and ⚙️ an Ansible role dependency declared in
meta/main.yml.
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.
Credits¶
Implemented by Kevin Veen-Birkenbach. Part of the Infinito.Nexus Project and maintained by Kevin Veen-Birkenbach. Licensed under the Infinito.Nexus Community License (Non-Commercial).