From d4850ec8bbeece1418be2f607ad5c81c271a2ce9 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 14 Mar 2025 12:09:17 +0100 Subject: [PATCH] Optimized .mds and meta/main.yml for systemd-notifier-telegram --- roles/systemd-notifier-telegram/README.md | 43 +++++++------------ roles/systemd-notifier-telegram/meta/main.yml | 25 +++++++++++ 2 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 roles/systemd-notifier-telegram/meta/main.yml diff --git a/roles/systemd-notifier-telegram/README.md b/roles/systemd-notifier-telegram/README.md index 9e875796..b9d504db 100644 --- a/roles/systemd-notifier-telegram/README.md +++ b/roles/systemd-notifier-telegram/README.md @@ -1,37 +1,24 @@ +# Automated Telegram Alerts for Service Failures + ## Description -This Ansible role installs the necessary components for sending Telegram notifications through systemd when any service fails. It configures the `systemd-notifier-telegram` service and handles the setup of Telegram bot parameters and notification templates. +This role installs and configures the necessary components for sending notifications via systemd when a service fails. It sets up the `systemd-notifier-telegram` service and configures parameters and customizable templates for sending messages through [Telegram](https://telegram.org). -Features include: +## Overview -- Installation and configuration of a Telegram notifier service. -- Customizable templates for Telegram messages sent on service failure. +Optimized for real-time alerts, this role is a key component of the overall [`systemd-notifier` suite](../). It ensures that, upon failure of a critical service, a Telegram message is automatically sent to notify administrators and enable prompt troubleshooting. -This role is part of the `systemd-notifier` suite, which provides a comprehensive solution for service failure notifications in a systemd environment. +## Purpose -## Requirements +The primary purpose of this role is to provide a robust solution for automated Telegram notifications in a systemd environment. By integrating with Telegram’s Bot API and using customizable message templates, it delivers clear and timely alerts about service failures, thereby enhancing system observability and reliability. -This role has the following requirements: +## Features -- Access to a Telegram bot token for sending messages. -- Availability of the `curl` package on the target system. +- **Service Installation & Configuration:** Installs and configures necessary components (including the `curl` package). +- **Customizable Templates:** Supports tailored Telegram message templates for service failure notifications. +- **Secure Notifications:** Leverages systemd to trigger alerts automatically when services fail. +- **Suite Integration:** Part of the [`systemd-notifier` suite](../) which includes related roles such as [systemd-notifier-email](../systemd-notifier-email/README.md) and others. + +## Further Information -## Role Variables - -The following variables can be customized in the role's `vars/main.yml` file: - -- `systemd_telegram_folder`: The path to the folder where Telegram-related scripts and configurations will be stored. -- `systemd_telegram_script`: The full path to the systemd-telegram.sh script. - -This role was created as part of a conversation with OpenAI's ChatGPT and can be found [here](https://chat.openai.com/share/96e4ca12-0888-41c0-9cfc-29c0180f0dba). - -## Usage - -To use this role, include it as a dependency in your playbook or role that requires Telegram notifications. Ensure that the `systemd-notifier-telegram` role is correctly referenced and configured. - -## Contact Information - -For any questions or feedback, please contact the author: - -Author: Kevin Veen-Birkenbach -Email: kevin@veen.world \ No newline at end of file +This role was developed as part of a conversation with OpenAI's ChatGPT and can be found [here](https://chat.openai.com/share/96e4ca12-0888-41c0-9cfc-29c0180f0dba). diff --git a/roles/systemd-notifier-telegram/meta/main.yml b/roles/systemd-notifier-telegram/meta/main.yml new file mode 100644 index 00000000..9b165995 --- /dev/null +++ b/roles/systemd-notifier-telegram/meta/main.yml @@ -0,0 +1,25 @@ +--- +galaxy_info: + author: "Kevin Veen-Birkenbach" + description: "Installs and configures components for sending Telegram notifications through systemd. This role is part of the systemd-notifier suite, providing automated alerts when services fail." + 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: + - telegram + - systemd + - notifications + - automation + - curl + repository: "https://s.veen.world/cymais" + issue_tracker_url: "https://s.veen.world/cymaisissues" + documentation: "https://s.veen.world/cymais" +dependencies: []