mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 23:08:06 +02:00
Changed systemd-notifier namings
This commit is contained in:
37
roles/systemd-notifier/README.md
Normal file
37
roles/systemd-notifier/README.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# systemd-notifier Ansible Role
|
||||
|
||||
Author: Kevin Veen-Birkenbach (kevin@veen.world)
|
||||
|
||||
## Description
|
||||
|
||||
This Ansible role installs a systemd service that sends notifications via both `systemd-notifier-telegram` and `systemd-notifier-email` when any service fails.
|
||||
|
||||
Features include:
|
||||
|
||||
- Configuration of a systemd service for notification.
|
||||
- Dependency management for the `systemd-notifier-telegram` and `systemd-notifier-email` roles.
|
||||
|
||||
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).
|
||||
|
||||
## License
|
||||
|
||||
This Ansible role is licensed under the AGPL v3 License. See the LICENSE file for the full license text.
|
||||
|
||||
## Role Dependencies
|
||||
|
||||
This role has the following dependencies:
|
||||
|
||||
- `systemd-notifier-telegram`
|
||||
- `systemd-notifier-email`
|
||||
|
||||
## Features
|
||||
|
||||
- Installs a systemd service for sending notifications.
|
||||
- Integrates with both Telegram and Email for notification delivery.
|
||||
|
||||
## Contact Information
|
||||
|
||||
For any questions or feedback, please contact the author:
|
||||
|
||||
Author: Kevin Veen-Birkenbach
|
||||
Email: kevin@veen.world
|
4
roles/systemd-notifier/handlers/main.yml
Normal file
4
roles/systemd-notifier/handlers/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
- name: "restart systemd-notifier service"
|
||||
systemd:
|
||||
name: systemd-notifier.service
|
||||
daemon_reload: yes
|
4
roles/systemd-notifier/meta/main.yml
Normal file
4
roles/systemd-notifier/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: systemd-notifier-telegram
|
||||
- role: systemd-notifier-email
|
6
roles/systemd-notifier/tasks/main.yml
Normal file
6
roles/systemd-notifier/tasks/main.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: configure systemd-notifier@.service
|
||||
template:
|
||||
src: systemd-notifier@.service.j2
|
||||
dest: "/etc/systemd/system/systemd-notifier@.service"
|
||||
notify: "restart systemd-notifier service"
|
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Notifier for %i
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/systemctl start systemd-notifier-telegram@%i.service systemd-notifier-email@%i.service
|
||||
User=root
|
||||
Group=systemd-journal
|
Reference in New Issue
Block a user