Go to file
2023-02-18 09:22:41 +03:00
defaults add Role 2023-02-18 09:22:41 +03:00
meta add Role 2023-02-18 09:22:41 +03:00
tasks add Role 2023-02-18 09:22:41 +03:00
templates add Role 2023-02-18 09:22:41 +03:00
vars add Role 2023-02-18 09:22:41 +03:00
.gitignore Initial commit 2023-02-17 12:51:03 +03:00
LICENSE Initial commit 2023-02-17 12:51:03 +03:00
README.md add Role 2023-02-18 09:22:41 +03:00

notification

Install E-Mail/Telegram notifications

Dependencies

  • Python 3.9 or above on inventory hosts (in repo on Debian | from sources in /usr/local/bin on CentOS)

Download a Role

wget -qO- https://git.hmp.today/pavel.muhortov/notification/archive/master.tar.gz | tar -xvz -C .

Edit Role Variables

# nano ./notification/vars/main.yml
sendmail_smtp: smtp.host.zone
sendmail_port: 587
sendmail_from: user@host.zone
sendmail_pass: pass
sendmail_dest: user@host.zone
sendtelegram_apikey: YOURAPIKEY
sendtelegram_chatid: 123456789

Create Playbook Example

tee ./notification.yml > /dev/null <<'EOF'
- name: Install E-Mail/Telegram notification
  hosts: all
  become: yes
  roles:
  - notification
EOF

Run Playbook

ansible-playbook ./notification.yml

Clean

rm -rf ./notification*