ansible-collection-prometheus/roles/alertmanager/templates/alertmanager.yml.j2
rezizter 6223e3b2da
enhancement: Add time_intervals to AlertManager (#251)
* enhancement: Add time_intervals to AlertManager

---------

Signed-off-by: Shaun Megaw <shaun.megaw@absa.africa>
2023-12-12 14:50:38 +01:00

60 lines
2.3 KiB
Django/Jinja

{{ ansible_managed | comment }}
global:
resolve_timeout: {{ alertmanager_resolve_timeout | quote}}
{% for key, value in alertmanager_smtp.items() %}
smtp_{{ key }}: {{ value | quote }}
{% endfor %}
{% if alertmanager_slack_api_url | string | length %}
slack_api_url: {{ alertmanager_slack_api_url | quote }}
{% endif %}
{% if alertmanager_http_config | length %}
http_config:
{{ alertmanager_http_config | to_nice_yaml(indent=2) | indent(4, False)}}
{% endif %}
{% if alertmanager_pagerduty_url | string | length %}
pagerduty_url: {{ alertmanager_pagerduty_url | quote }}
{% endif %}
{% if alertmanager_opsgenie_api_key | string | length %}
opsgenie_api_key: {{ alertmanager_opsgenie_api_key | quote }}
{% endif %}
{% if alertmanager_opsgenie_api_url | string | length %}
opsgenie_api_url: {{ alertmanager_opsgenie_api_url | quote }}
{% endif %}
{% if alertmanager_victorops_api_key | string | length %}
victorops_api_key: {{ alertmanager_victorops_api_key | quote }}
{% endif %}
{% if alertmanager_victorops_api_url | string | length %}
victorops_api_url: {{ alertmanager_victorops_api_url | quote }}
{% endif %}
{% if alertmanager_hipchat_api_url | string | length %}
hipchat_api_url: {{ alertmanager_hipchat_api_url | quote }}
{% endif %}
{% if alertmanager_hipchat_auth_token | string | length %}
hipchat_auth_token: {{ alertmanager_hipchat_auth_token | quote }}
{% endif %}
{% if alertmanager_wechat_url | string | length %}
wechat_api_url: {{ alertmanager_wechat_url | quote }}
{% endif %}
{% if alertmanager_wechat_secret | string | length %}
wechat_api_secret: {{ alertmanager_wechat_secret | quote }}
{% endif %}
{% if alertmanager_wechat_corp_id | string | length %}
wechat_api_corp_id: {{ alertmanager_wechat_corp_id | quote }}
{% endif %}
templates:
- '{{ alertmanager_config_dir }}/templates/*.tmpl'
{% if alertmanager_receivers | length %}
receivers:
{{ alertmanager_receivers | to_nice_yaml(indent=2) }}
{% endif %}
{% if alertmanager_inhibit_rules | length %}
inhibit_rules:
{{ alertmanager_inhibit_rules | to_nice_yaml(indent=2) }}
{% endif %}
{% if alertmanager_time_intervals | length %}
time_intervals:
{{ alertmanager_time_intervals | to_nice_yaml(indent=2) }}
{% endif %}
route:
{{ alertmanager_route | to_nice_yaml(indent=2) | indent(2, False) }}