- Replace legacy utils/run_once.yml with the new helpers utils/once_flag.yml and utils/once_finalize.yml - Introduce utils/compose_up.yml to ensure docker-compose stacks are up and to flush handlers safely without coupling to run-once flags - Migrate all affected roles (desk-*, dev-*, sys-ctl-*, sys-svc-*, web-app-*, web-svc-*, util-*) to the new run-once helpers - Rework sys-svc-msmtp to auto-load Mailu once per deploy, check reachability, and reuse the running stack instead of requiring multiple playbook passes - Adjust web-app-mailu to integrate cert deployment, handler flushing, and run-once handling so Mailu is fully initialized in a single deploy - Improve Matomo, CDN, logout and CSP/health-check related roles to cooperate with the new compose_up / once_* pattern - Simplify alarm/backup/timer/service orchestration (sys-ctl-alm-*, sys-bkp-provider, sys-timer-cln-bkps, etc.) by moving run-once logic into dedicated 01_core.yml files - Update integration tests so utils/once_flag.yml and utils/once_finalize.yml are recognised as valid run-once providers, keeping the global run_once_* guarantees consistent - Align frontend injection and service dependencies so Mastodon- and Mailu-related services can be brought up coherently within a single deployment cycle rather than several iterations
Backup to USB
Description
This Ansible role automates backups to a removable USB device on Arch Linux systems. It ensures that a custom Python backup script is deployed, the necessary systemd units are configured, and backups are triggered whenever the specified USB mount point becomes available.
Overview
Designed for Arch Linux, this role validates configuration variables (mount, target, source), installs the backup script, generates a systemd service, and sets up a corresponding mount unit. When the USB device is mounted, the service runs the script to synchronize files from the source directory to the USB target, preserving previous snapshots via hard links.
Purpose
The purpose of this role is to provide a reliable, idempotent solution for local backups to a swappable USB drive. By automating the entire workflow—from variable checks and script deployment to service orchestration and snapshot management—it reduces manual intervention and integrates seamlessly with other Infinito.Nexus roles for comprehensive system automation.
Features
- Configuration Validation: Fails early if any of
backup_to_usb_mount,backup_to_usb_target, orbackup_to_usb_sourceis empty. - Script Deployment: Copies the
svc-bkp-loc-2-usb.pybackup script to the target path with correct ownership and permissions. - Systemd Integration: Generates and installs a systemd mount unit for the USB device and a oneshot service that triggers backup upon mount.
- Snapshot Backups: Uses
rsync --link-destto create incremental snapshots and preserve previous versions without duplicating unchanged files. - Idempotent Runs: Ensures tasks only run when needed and leverages Ansible’s
assertand state management for consistent behavior. - Service Reload Handlers: Automatically reloads the systemd service when template changes occur.
Credits
Developed and maintained by Kevin Veen-Birkenbach. Visit veen.world for more information.
Part of the Infinito.Nexus Project License: Infinito.Nexus NonCommercial License