mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-09 22:41:03 +01:00
Changed systemd-notifier namings
This commit is contained in:
parent
d3de68b216
commit
3120b23eb4
@ -1,5 +1,5 @@
|
||||
dependencies:
|
||||
- git
|
||||
- backups-provider
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
- cleanup-failed-docker-backups
|
@ -1,5 +1,5 @@
|
||||
dependencies:
|
||||
- git
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
- cleanup-backups-timer
|
||||
- cleanup-failed-docker-backups
|
||||
|
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- nginx
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- python-pip
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -1,2 +1,2 @@
|
||||
dependencies:
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- git
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- nginx-docker-reverse-proxy
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -9,4 +9,4 @@ galaxy_info:
|
||||
- all
|
||||
dependencies:
|
||||
- system-aur-helper
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -1,2 +1,2 @@
|
||||
dependencies:
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -1,2 +1,2 @@
|
||||
dependencies:
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -18,4 +18,4 @@ This Ansible role is designed to ensure the health of Docker containers running
|
||||
|
||||
To use this role, include it in your playbook and set the `path_administrator_scripts` variable to the desired path for the health check scripts.
|
||||
|
||||
Ensure that the `systemd_notifier` dependency is satisfied for error notifications.
|
||||
Ensure that the `systemd-notifier` dependency is satisfied for error notifications.
|
@ -1,2 +1,2 @@
|
||||
dependencies:
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -18,7 +18,7 @@ This role checks for anonymous Docker volumes that are not bound to a container
|
||||
|
||||
Include this role in your playbook and set the `path_administrator_scripts` variable to determine where the health check scripts should reside. Define `whitelisted_anonymous_volumes` in `vars/main.yml` with an array of volume IDs that should be ignored by the health check.
|
||||
|
||||
Ensure that the `systemd_notifier` dependency is satisfied for error notifications.
|
||||
Ensure that the `systemd-notifier` dependency is satisfied for error notifications.
|
||||
|
||||
## Created with AI
|
||||
This script was created with the help of AI. The full conversation you find [here](https://chat.openai.com/share/1fa829f1-f001-4111-b1d4-1b2e3d583da2).
|
||||
|
@ -1,2 +1,2 @@
|
||||
dependencies:
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -1,2 +1,2 @@
|
||||
dependencies:
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -1,3 +1,3 @@
|
||||
dependencies:
|
||||
- python-pip
|
||||
- systemd_notifier
|
||||
- systemd-notifier
|
||||
|
@ -1,17 +1,17 @@
|
||||
# systemd_notifier_email Ansible Role
|
||||
# systemd-notifier-email Ansible Role
|
||||
|
||||
Author: Kevin Veen-Birkenbach (kevin@veen.world)
|
||||
|
||||
## Description
|
||||
|
||||
This Ansible role installs the necessary components for sending email notifications through systemd when any service fails. It configures the `systemd_notifier_email` service and handles the setup of email parameters and templates.
|
||||
This Ansible role installs the necessary components for sending email notifications through systemd when any service fails. It configures the `systemd-notifier-email` service and handles the setup of email parameters and templates.
|
||||
|
||||
Features include:
|
||||
|
||||
- Installation and configuration of an email sending service.
|
||||
- Customizable email templates for service failure notifications.
|
||||
|
||||
This role is part of the `systemd_notifier` suite, which provides a comprehensive solution for service failure notifications in a systemd environment.
|
||||
This role is part of the `systemd-notifier` suite, which provides a comprehensive solution for service failure notifications in a systemd environment.
|
||||
|
||||
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).
|
||||
|
||||
@ -30,7 +30,7 @@ The following variables can be customized in the role's `vars/main.yml` file:
|
||||
|
||||
## Usage
|
||||
|
||||
To use this role, include it as a dependency in your playbook or role that requires email notifications. Ensure that the `systemd_notifier_email` role is correctly referenced and configured.
|
||||
To use this role, include it as a dependency in your playbook or role that requires email notifications. Ensure that the `systemd-notifier-email` role is correctly referenced and configured.
|
||||
|
||||
## License
|
||||
|
4
roles/systemd-notifier-email/handlers/main.yml
Normal file
4
roles/systemd-notifier-email/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
- name: "restart systemd-notifier-email service"
|
||||
systemd:
|
||||
name: systemd-notifier-email.service
|
||||
daemon_reload: yes
|
18
roles/systemd-notifier-email/tasks/main.yml
Normal file
18
roles/systemd-notifier-email/tasks/main.yml
Normal file
@ -0,0 +1,18 @@
|
||||
- name: install smtp-forwarder
|
||||
pacman: name=smtp-forwarder state=present
|
||||
|
||||
- name: configure msmtprc.conf.j2
|
||||
template: src=msmtprc.conf.j2 dest=/root/.msmtprc
|
||||
|
||||
- name: "create {{systemd_notifier_email_folder}}"
|
||||
file:
|
||||
path: "{{systemd_notifier_email_folder}}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: configure systemd-notifier-email.sh
|
||||
template: src=systemd-notifier-email.sh.j2 dest={{systemd_notifier_email_folder}}systemd-notifier-email.sh
|
||||
|
||||
- name: configure systemd-notifier-email.service
|
||||
template: src=systemd-notifier-email@.service.j2 dest=/etc/systemd/system/systemd-notifier-email@.service
|
||||
notify: restart systemd-notifier-email service
|
@ -3,6 +3,6 @@ Description=status email for %i to user
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash {{systemd_notifier_email_folder}}systemd_notifier_email.sh %i
|
||||
ExecStart=/bin/bash {{systemd_notifier_email_folder}}systemd-notifier-email.sh %i
|
||||
User=root
|
||||
Group=systemd-journal
|
@ -1 +1 @@
|
||||
systemd_notifier_email_folder: "{{path_administrator_scripts}}systemd_notifier_email/"
|
||||
systemd_notifier_email_folder: "{{path_administrator_scripts}}systemd-notifier-email/"
|
@ -1,13 +1,13 @@
|
||||
## 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 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.
|
||||
|
||||
Features include:
|
||||
|
||||
- Installation and configuration of a Telegram notifier service.
|
||||
- Customizable templates for Telegram messages sent on service failure.
|
||||
|
||||
This role is part of the `systemd_notifier` suite, which provides a comprehensive solution for service failure notifications in a systemd environment.
|
||||
This role is part of the `systemd-notifier` suite, which provides a comprehensive solution for service failure notifications in a systemd environment.
|
||||
|
||||
## Requirements
|
||||
|
||||
@ -20,14 +20,14 @@ This role has the following requirements:
|
||||
|
||||
The following variables can be customized in the role's `vars/main.yml` file:
|
||||
|
||||
- `systemd_notifier_telegram_folder`: The path to the folder where Telegram-related scripts and configurations will be stored.
|
||||
- `systemd_notifier_telegram_script`: The full path to the systemd-telegram.sh script.
|
||||
- `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.
|
||||
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.
|
||||
|
||||
## License
|
||||
|
4
roles/systemd-notifier-telegram/handlers/main.yml
Normal file
4
roles/systemd-notifier-telegram/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
- name: "restart systemd-notifier-telegram service"
|
||||
systemd:
|
||||
name: systemd-notifier-telegram.service
|
||||
daemon_reload: yes
|
21
roles/systemd-notifier-telegram/tasks/main.yml
Normal file
21
roles/systemd-notifier-telegram/tasks/main.yml
Normal file
@ -0,0 +1,21 @@
|
||||
- name: install curl
|
||||
pacman:
|
||||
name: curl
|
||||
state: present
|
||||
|
||||
- name: Create a directory with a subdirectory
|
||||
ansible.builtin.file:
|
||||
path: "{{systemd_telegram_folder}}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: configure systemd-notifier-telegram.sh
|
||||
template:
|
||||
src: systemd-notifier-telegram.sh.j2
|
||||
dest: "{{ systemd_telegram_script }}"
|
||||
|
||||
- name: configure systemd-notifier-telegram.service
|
||||
template:
|
||||
src: systemd-notifier-telegram@.service.j2
|
||||
dest: "/etc/systemd/system/systemd-notifier-telegram@.service"
|
||||
notify: "restart systemd-notifier-telegram service"
|
2
roles/systemd-notifier-telegram/vars/main.yml
Normal file
2
roles/systemd-notifier-telegram/vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
systemd_telegram_folder: "/opt/ansible-roles/systemd-notifier-telegram/"
|
||||
systemd_telegram_script: "{{systemd_telegram_folder}}systemd-notifier-telegram.sh"
|
@ -1,15 +1,15 @@
|
||||
# systemd_notifier Ansible Role
|
||||
# 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.
|
||||
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.
|
||||
- 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).
|
||||
|
||||
@ -21,8 +21,8 @@ This Ansible role is licensed under the AGPL v3 License. See the LICENSE file fo
|
||||
|
||||
This role has the following dependencies:
|
||||
|
||||
- `systemd_notifier_telegram`
|
||||
- `systemd_notifier_email`
|
||||
- `systemd-notifier-telegram`
|
||||
- `systemd-notifier-email`
|
||||
|
||||
## Features
|
||||
|
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
|
@ -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
|
@ -1,4 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: systemd_notifier_telegram
|
||||
- role: systemd_notifier_email
|
@ -1,8 +0,0 @@
|
||||
[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
|
@ -1,4 +0,0 @@
|
||||
- name: "restart systemd_notifier_email service"
|
||||
systemd:
|
||||
name: systemd_notifier_email.service
|
||||
daemon_reload: yes
|
@ -1,18 +0,0 @@
|
||||
- name: install smtp-forwarder
|
||||
pacman: name=smtp-forwarder state=present
|
||||
|
||||
- name: configure msmtprc.conf.j2
|
||||
template: src=msmtprc.conf.j2 dest=/root/.msmtprc
|
||||
|
||||
- name: "create {{systemd_notifier_email_folder}}"
|
||||
file:
|
||||
path: "{{systemd_notifier_email_folder}}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: configure systemd_notifier_email.sh
|
||||
template: src=systemd_notifier_email.sh.j2 dest={{systemd_notifier_email_folder}}systemd_notifier_email.sh
|
||||
|
||||
- name: configure systemd_notifier_email.service
|
||||
template: src=systemd_notifier_email@.service.j2 dest=/etc/systemd/system/systemd_notifier_email@.service
|
||||
notify: restart systemd_notifier_email service
|
@ -1,4 +0,0 @@
|
||||
- name: "restart systemd_notifier_telegram service"
|
||||
systemd:
|
||||
name: systemd_notifier_telegram.service
|
||||
daemon_reload: yes
|
@ -1,21 +0,0 @@
|
||||
- name: install curl
|
||||
pacman:
|
||||
name: curl
|
||||
state: present
|
||||
|
||||
- name: Create a directory with a subdirectory
|
||||
ansible.builtin.file:
|
||||
path: "{{systemd_telegram_folder}}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: configure systemd_notifier_telegram.sh
|
||||
template:
|
||||
src: systemd_notifier_telegram.sh.j2
|
||||
dest: "{{ systemd_telegram_script }}"
|
||||
|
||||
- name: configure systemd_notifier_telegram.service
|
||||
template:
|
||||
src: systemd_notifier_telegram@.service.j2
|
||||
dest: "/etc/systemd/system/systemd_notifier_telegram@.service"
|
||||
notify: "restart systemd_notifier_telegram service"
|
@ -1,2 +0,0 @@
|
||||
systemd_telegram_folder: "/opt/ansible-roles/systemd_notifier_telegram/"
|
||||
systemd_telegram_script: "{{systemd_telegram_folder}}systemd_notifier_telegram.sh"
|
Loading…
Reference in New Issue
Block a user