mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Renamed alert-bot to alert-compose
This commit is contained in:
20
roles/alert-compose/README.md
Normal file
20
roles/alert-compose/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Unified Service Failure Notifier
|
||||
|
||||
## Description
|
||||
|
||||
This role installs a systemd service that sends notifications via both [alert-telegram](../alert-telegram/README.md) and [alert-email](../alert-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 [alert-telegram](../alert-telegram/README.md) and [alert-email](../alert-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.
|
10
roles/alert-compose/handlers/main.yml
Normal file
10
roles/alert-compose/handlers/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
- name: "restart alert-compose service"
|
||||
systemd:
|
||||
name: alert-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
|
27
roles/alert-compose/meta/main.yml
Normal file
27
roles/alert-compose/meta/main.yml
Normal 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:
|
||||
- alert-telegram
|
||||
- alert-email
|
12
roles/alert-compose/tasks/main.yml
Normal file
12
roles/alert-compose/tasks/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- name: configure alert-compose.cymais@.service
|
||||
template:
|
||||
src: alert-compose@.service.j2
|
||||
dest: "/etc/systemd/system/alert-compose.cymais@.service"
|
||||
notify: "restart alert-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
|
8
roles/alert-compose/templates/alert-compose@.service.j2
Normal file
8
roles/alert-compose/templates/alert-compose@.service.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Notifier for %i
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/systemctl start alert-telegram.cymais@%i.service alert-email.cymais@%i.service
|
||||
User=root
|
||||
Group=systemd-journal
|
Reference in New Issue
Block a user