- Add discord_webhook_alerts and discord_webhook_deploys to vault + main.yml - AlertManager: send alerts to both Telegram and Discord #alerts channel - Forgejo: auto-create Discord webhook on repo pushes → #deploys channel Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
38 lines
1.3 KiB
Django/Jinja
38 lines
1.3 KiB
Django/Jinja
# Generated by Ansible — do not edit manually
|
|
global:
|
|
resolve_timeout: 5m
|
|
|
|
route:
|
|
group_by: [alertname, severity]
|
|
group_wait: 30s
|
|
group_interval: 5m
|
|
repeat_interval: 4h
|
|
receiver: all
|
|
|
|
receivers:
|
|
- name: all
|
|
telegram_configs:
|
|
- bot_token: "{{ alertmanager_telegram_token }}"
|
|
chat_id: {{ alertmanager_telegram_chat_id }}
|
|
message: |
|
|
{{ '{{' }} range .Alerts {{ '}}' }}
|
|
{{ '{{' }} if eq .Status "firing" {{ '}}' }}🔴{{ '{{' }} else {{ '}}' }}🟢{{ '{{' }} end {{ '}}' }} *{{ '{{' }} .Labels.alertname {{ '}}' }}*
|
|
{{ '{{' }} .Annotations.summary {{ '}}' }}
|
|
{{ '{{' }} .Annotations.description {{ '}}' }}
|
|
{{ '{{' }} end {{ '}}' }}
|
|
parse_mode: Markdown
|
|
discord_configs:
|
|
- webhook_url: "{{ discord_webhook_alerts }}"
|
|
title: >-
|
|
{{ '{{' }} if eq (index .Alerts 0).Status "firing" {{ '}}' }}🔴 Alert{{ '{{' }} else {{ '}}' }}🟢 Resolved{{ '{{' }} end {{ '}}' }}
|
|
message: |
|
|
{{ '{{' }} range .Alerts {{ '}}' }}
|
|
**{{ '{{' }} .Labels.alertname {{ '}}' }}**
|
|
{{ '{{' }} .Annotations.summary {{ '}}' }}
|
|
{{ '{{' }} .Annotations.description {{ '}}' }}
|
|
{{ '{{' }} end {{ '}}' }}
|
|
|
|
inhibit_rules:
|
|
- source_matchers: [severity="critical"]
|
|
target_matchers: [severity="warning"]
|
|
equal: [alertname]
|