Optimized tests für run once

This commit is contained in:
2025-08-12 02:38:37 +02:00
parent 82aaf7ad74
commit 1595a7c4a6
148 changed files with 1803 additions and 1147 deletions

View File

@@ -1,4 +1,3 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: "Installs and configures components for sending Telegram notifications through systemd. This role is part of the sys-alm-compose suite, providing automated alerts when services fail."
@@ -10,17 +9,15 @@ galaxy_info:
https://www.veen.world
min_ansible_version: "2.9"
platforms:
- name: Archlinux
versions:
- rolling
- name: Archlinux
versions:
- rolling
galaxy_tags:
- telegram
- systemd
- notifications
- automation
- curl
- telegram
- systemd
- notifications
- automation
- curl
repository: "https://github.com/kevinveenbirkenbach/infinito-nexus"
issue_tracker_url: "https://github.com/kevinveenbirkenbach/infinito-nexus/issues"
documentation: "https://docs.infinito.nexus"
dependencies:
- sys-rst-daemon

View File

@@ -1,8 +1,16 @@
- name: Load former meta dependencies once
block:
- name: Include moved dependency 'sys-rst-daemon'
include_role:
name: sys-rst-daemon
- set_fact:
run_once_sys_alm_telegram: true
when: run_once_sys_alm_telegram is not defined
- name: Fail if Telegram bot credentials are not set
assert:
that:
- telegram_bot_token != ""
- telegram_chat_id != ""
- telegram_bot_token != ""
- telegram_chat_id != ""
fail_msg: |
Telegram configuration is incomplete!
Please provide nonempty values for:
@@ -10,7 +18,7 @@
- telegram_chat_id # The Telegram chat ID to send messages to
- name: install curl
community.general.pacman:
community.general.pacman:
name: curl
state: present
@@ -21,12 +29,12 @@
mode: '0755'
- name: configure sys-alm-telegram.sh
template:
src: sys-alm-telegram.sh.j2
template:
src: sys-alm-telegram.sh.j2
dest: "{{ systemd_telegram_script }}"
- name: configure sys-alm-telegram.infinito.service
template:
src: sys-alm-telegram@.service.j2
template:
src: sys-alm-telegram@.service.j2
dest: "/etc/systemd/system/sys-alm-telegram.infinito@.service"
notify: "restart sys-alm-telegram service"