apprise: заведён бандл alerts, netdata снова доставляет уведомления
- netdata слал в бандл server, удалённый при переименовании в backups, и все health-алерты уходили в 404 - бандлы теперь рендерятся циклом: backups для отчётов backup-all.py, alerts для netdata
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# Бандл alerts — health-алерты netdata. Каналы совпадают с backups
|
||||
# намеренно: разведены источники, чтобы позже можно было сменить адресатов
|
||||
# алертов, не трогая отчёты бэкапов.
|
||||
mailtos://{{ postbox_user }}:{{ postbox_pass }}@{{ postbox_host }}:{{ postbox_port }}/?from=notifications@vakhrushev.me&to={{ notifications_email }}
|
||||
# Пароль бота экранируем дважды: jinja-фильтр urlencode оставляет '/' как есть
|
||||
# (safe='/'), а в пароле он развалил бы путь URL. После urlencode литеральных
|
||||
# процентов в строке нет, поэтому замена '/' на %2F безопасна.
|
||||
matrix://apprise:{{ notifications_matrix_bot_password | urlencode | regex_replace('/', '%2F') }}@tuwunel:6167/{{ notifications_matrix_room }}?msgtype=text
|
||||
@@ -3,13 +3,13 @@
|
||||
|
||||
SEND_EMAIL="NO"
|
||||
SEND_CUSTOM="YES"
|
||||
DEFAULT_RECIPIENT_CUSTOM="server"
|
||||
DEFAULT_RECIPIENT_CUSTOM="alerts"
|
||||
|
||||
role_recipients_custom[sysadmin]="server"
|
||||
role_recipients_custom[domainadmin]="server"
|
||||
role_recipients_custom[dba]="server"
|
||||
role_recipients_custom[webmaster]="server"
|
||||
role_recipients_custom[proxyadmin]="server"
|
||||
role_recipients_custom[sysadmin]="alerts"
|
||||
role_recipients_custom[domainadmin]="alerts"
|
||||
role_recipients_custom[dba]="alerts"
|
||||
role_recipients_custom[webmaster]="alerts"
|
||||
role_recipients_custom[proxyadmin]="alerts"
|
||||
role_recipients_custom[silent]=""
|
||||
|
||||
custom_sender() {
|
||||
|
||||
@@ -46,13 +46,19 @@
|
||||
path: "{{ config_dir }}/server.cfg"
|
||||
state: "absent"
|
||||
|
||||
- name: "Copy apprise config"
|
||||
# Бандл на источник уведомлений: backups — отчёты backup-all.py, alerts —
|
||||
# health-алерты netdata. Каналы у них сейчас одинаковые, но адресатов можно
|
||||
# развести, не трогая сами источники.
|
||||
- name: "Copy apprise config bundles"
|
||||
ansible.builtin.template:
|
||||
src: "./files/{{ app_name }}/backups.template.cfg"
|
||||
dest: "{{ config_dir }}/backups.cfg"
|
||||
src: "./files/{{ app_name }}/{{ item }}.template.cfg"
|
||||
dest: "{{ config_dir }}/{{ item }}.cfg"
|
||||
owner: "{{ app_user }}"
|
||||
group: "{{ app_user }}"
|
||||
mode: "0640"
|
||||
loop:
|
||||
- "backups"
|
||||
- "alerts"
|
||||
# Файл содержит секреты из vault — без no_log их печатает --diff.
|
||||
no_log: true
|
||||
notify: "Restart application"
|
||||
|
||||
Reference in New Issue
Block a user