diff options
author | Christian Pointner <equinox@spreadspace.org> | 2022-03-11 21:29:32 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2022-03-11 21:29:32 +0100 |
commit | 91ed93a6fb112928bdce45c5bfb608c6ff26a611 (patch) | |
tree | 3e28f6c111086d9d1429d786130946393a1e6cb0 /roles/monitoring/alerta/templates/alertad.conf.j2.j2 | |
parent | alerta: improve support for mailer (diff) |
alerta: less hardcoded stuff in configs
Diffstat (limited to 'roles/monitoring/alerta/templates/alertad.conf.j2.j2')
-rw-r--r-- | roles/monitoring/alerta/templates/alertad.conf.j2.j2 | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/roles/monitoring/alerta/templates/alertad.conf.j2.j2 b/roles/monitoring/alerta/templates/alertad.conf.j2.j2 index 54089a76..b013f480 100644 --- a/roles/monitoring/alerta/templates/alertad.conf.j2.j2 +++ b/roles/monitoring/alerta/templates/alertad.conf.j2.j2 @@ -1,18 +1,17 @@ DEBUG = {{ '{{' }} 'True' if env.DEBUG else 'False' {{ '}}' }} SECRET = "{{ '{{' }} env.SECRET_KEY {{ '}}' }}" -ALERT_TIMEOUT = 86400 -HEARTBEAT_TIMEOUT = 7200 +ALERT_TIMEOUT = {{ alerta_alert_timeout }} +HEARTBEAT_TIMEOUT = {{ alerta_heartbeat_timeout }} +DEFAULT_ENVIRONMENT = '{{ alerta_default_environment }}' +ALLOWED_ENVIRONMENTS = ['{{ alerta_environments | join("', '") }}'] PLUGINS = ['{{ alerta_plugins | join("', '") }}'] -DEFAULT_ENVIRONMENT = 'unknown' -ALLOWED_ENVIRONMENTS = ['unknown', 'chaos-at-.*'] {% if 'heartbeat' in alerta_plugins %} -HEARTBEAT_EVENTS = ['PrometheusAlertmanagerE2eDeadManSwitch'] +HEARTBEAT_EVENTS = ['{{ alerta_plugin_heartbeat.events | join("', '") }}'] {% endif %} {% if 'prometheus' in alerta_plugins %} -ALERTMANAGER_USERNAME = 'alerta' -ALERTMANAGER_PASSWORD = 'alerta' -ALERTMANAGER_SILENCE_FROM_ACK = True -ALERTMANAGER_USE_EXTERNALURL_FOR_SILENCES = True +{% for opt, value in alerta_plugin_prometheus.items() %} +ALERTMANAGER_{{ opt | upper }} = {{ value }} +{% endfor %} {% endif %} {% if 'amqp' in alerta_plugins %} AMQP_URL = 'redis://localhost:6379/' |