mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 15:28:12 +02:00
Refactor systemctl services and categories due to alarm bugs
This commit restructures systemctl service definitions and category mappings. Motivation: Alarm-related bugs revealed inconsistencies in service and role handling. Preparation step: lays the groundwork for fixing the alarm issues by aligning categories, roles, and service templates.
This commit is contained in:
21
roles/sys-timer-cln-bkps/README.md
Normal file
21
roles/sys-timer-cln-bkps/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Cleanup Backups Timer
|
||||
|
||||
## Description
|
||||
|
||||
This role sets up a systemd timer to schedule the periodic cleanup of old backups. It leverages the sys-ctl-cln-bkps role to perform the actual cleanup operation.
|
||||
|
||||
## Overview
|
||||
|
||||
Optimized for automated maintenance, this role:
|
||||
- Sets a fact for the service name.
|
||||
- Integrates with the [sys-timer](../sys-timer/README.md) role to schedule sys-ctl-cln-backups tasks at defined intervals.
|
||||
|
||||
## Purpose
|
||||
|
||||
The primary purpose of this role is to automate the scheduling of backup cleanup operations using a systemd timer, ensuring that backup storage remains within defined limits.
|
||||
|
||||
## Features
|
||||
|
||||
- **Timer Scheduling:** Configures a systemd timer to trigger the backup cleanup service.
|
||||
- **Role Integration:** Works in conjunction with the sys-ctl-cln-bkps role.
|
||||
- **Idempotency:** Ensures the timer tasks execute only once per playbook run.
|
22
roles/sys-timer-cln-bkps/meta/main.yml
Normal file
22
roles/sys-timer-cln-bkps/meta/main.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
galaxy_info:
|
||||
author: "Kevin Veen-Birkenbach"
|
||||
description: "Schedules periodic cleanup of old backups by configuring a systemd timer to trigger the sys-ctl-cln-bkps role."
|
||||
license: "Infinito.Nexus NonCommercial License"
|
||||
license_url: "https://s.infinito.nexus/license"
|
||||
company: |
|
||||
Kevin Veen-Birkenbach
|
||||
Consulting & Coaching Solutions
|
||||
https://www.veen.world
|
||||
min_ansible_version: "2.9"
|
||||
platforms:
|
||||
- name: Linux
|
||||
versions:
|
||||
- all
|
||||
galaxy_tags:
|
||||
- timer
|
||||
- backup
|
||||
- cleanup
|
||||
- automation
|
||||
repository: "https://s.infinito.nexus/code"
|
||||
issue_tracker_url: "https://s.infinito.nexus/issues"
|
||||
documentation: "https://docs.infinito.nexus"
|
16
roles/sys-timer-cln-bkps/tasks/01_core.yml
Normal file
16
roles/sys-timer-cln-bkps/tasks/01_core.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
- name: Include dependencies
|
||||
include_role:
|
||||
name: '{{ item }}'
|
||||
loop:
|
||||
- sys-ctl-cln-bkps
|
||||
- sys-rst-daemon
|
||||
|
||||
- name: set service_name to sys-ctl-cln-backups
|
||||
set_fact:
|
||||
service_name: "sys-ctl-cln-backups"
|
||||
|
||||
- name: "include role for sys-timer for {{ service_name }}"
|
||||
include_role:
|
||||
name: sys-timer
|
||||
vars:
|
||||
on_calendar: "{{SYS_SCHEDULE_CLEANUP_BACKUPS}}"
|
6
roles/sys-timer-cln-bkps/tasks/main.yml
Normal file
6
roles/sys-timer-cln-bkps/tasks/main.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
- block:
|
||||
- include_tasks: 01_core.yml
|
||||
- name: run the cleanup_backups_timer tasks once
|
||||
set_fact:
|
||||
run_once_sys_timer_cln_bkps: true
|
||||
when: run_once_sys_timer_cln_bkps is not defined
|
Reference in New Issue
Block a user