xoxys.alertmanager/templates/conf/alertmanager.yml.j2

45 lines
1.4 KiB
Plaintext
Raw Normal View History

2021-06-02 22:01:24 +00:00
#jinja2: lstrip_blocks: True
{{ ansible_managed | comment }}
global:
resolve_timeout: {{ alertmanager_resolve_timeout | quote }}
{% if alertmanager_smtp_host is defined %}
smtp_smarthost: "{{ alertmanager_smtp_host }}:{{ alertmanager_smtp_port }}"
smtp_from: {{ alertmanager_smtp_from }}
smtp_auth_username: {{ alertmanager_smtp_auth_username }}
smtp_auth_password: '{{ alertmanager_smtp_auth_password }}'
smtp_require_tls: {{ alertmanager_smtp_require_tls | bool | lower }}
{% endif %}
templates:
- '{{ alertmanager_config_dir }}/templates/*.tmpl'
route:
{% if alertmanager_route_group_by | length > 0 %}
group_by:
{{ alertmanager_route_group_by | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
group_wait: {{ alertmanager_route_group_wait }}
group_interval: {{ alertmanager_route_group_interval }}
repeat_interval: {{ alertmanager_route_repeat_interval }}
{% if alertmanager_route_default_receiver is defined %}
receiver: {{ alertmanager_route_default_receiver }}
{% endif %}
{% if alertmanager_route_routes | length > 0 %}
routes:
{{ alertmanager_route_routes | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
{% if alertmanager_receivers | length > 0 %}
receivers:
{{ alertmanager_receivers | to_nice_yaml(indent=2) }}
{% endif %}
{% if alertmanager_inhibit_rules | length > 0 %}
inhibit_rules:
{{ alertmanager_inhibit_rules | to_nice_yaml(indent=2) }}
{% endif %}