Another big round of refactoring and cleaning...

This commit is contained in:
2025-07-11 17:55:26 +02:00
parent aa61bf2a44
commit 168c5c0da6
323 changed files with 761 additions and 811 deletions

View File

@@ -0,0 +1,20 @@
# Unified Service Failure Notifier
## Description
This role installs a systemd service that sends notifications via both [sys-alm-telegram](../sys-alm-telegram/README.md) and [sys-alm-email](../sys-alm-email/README.md) when any service fails.
## Overview
Optimized for prompt and comprehensive failure alerts, this role configures a unified notification service. It leverages the capabilities of both Telegram and Email notifications to ensure that administrators are quickly informed about service issues, enabling rapid troubleshooting.
## Purpose
The primary purpose of this role is to provide a centralized mechanism for service failure notifications. By integrating with both the Telegram and Email notifier roles, it delivers reliable alerts through multiple channels, enhancing overall system observability and responsiveness.
## Features
- **Unified Notification Service:** Installs a systemd service that triggers both Telegram and Email alerts.
- **Dependency Integration:** Works seamlessly with the [sys-alm-telegram](../sys-alm-telegram/README.md) and [sys-alm-email](../sys-alm-email/README.md) roles.
- **Automated Service Management:** Automatically restarts the notifier service upon configuration changes.
- **Centralized Alerting:** Provides a unified approach to monitor and notify about service failures.

View File

@@ -0,0 +1,10 @@
- name: "restart sys-alm-compose service"
systemd:
name: sys-alm-compose.cymais.service
daemon_reload: yes
when: run_once_systemd_notifier_service is not defined
- name: run the systemd_notifier_service tasks once
set_fact:
run_once_systemd_notifier_service: true
when: run_once_systemd_notifier_service is not defined

View File

@@ -0,0 +1,27 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: "Installs a unified systemd notification service that sends alerts via both Telegram and Email when a service fails."
license: "CyMaIS NonCommercial License (CNCL)"
license_url: "https://s.veen.world/cncl"
company: |
Kevin Veen-Birkenbach
Consulting & Coaching Solutions
https://www.veen.world
min_ansible_version: "2.9"
platforms:
- name: Archlinux
versions:
- rolling
galaxy_tags:
- systemd
- notifier
- telegram
- email
- notifications
repository: "https://s.veen.world/cymais"
issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais"
dependencies:
- sys-alm-telegram
- sys-alm-email

View File

@@ -0,0 +1,12 @@
---
- name: configure sys-alm-compose.cymais@.service
template:
src: sys-alm-compose@.service.j2
dest: "/etc/systemd/system/sys-alm-compose.cymais@.service"
notify: "restart sys-alm-compose service"
when: run_once_systemd_notifier_service is not defined
- name: run the systemd_notifier_service tasks once
set_fact:
run_once_systemd_notifier_service: true
when: run_once_systemd_notifier_service is not defined

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Notifier for %i
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl start sys-alm-telegram.cymais@%i.service sys-alm-email.cymais@%i.service
User=root
Group=systemd-journal