2020-11-13 10:36:46 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: render alertmanager runtime arguments
|
2021-11-03 02:25:21 +01:00
|
|
|
ansible.builtin.lineinfile:
|
2020-11-13 10:36:46 +01:00
|
|
|
path: /etc/default/prometheus-alertmanager
|
|
|
|
regexp: "^ARGS=.*$"
|
|
|
|
line: >-
|
|
|
|
ARGS="{{ alertmanager_arguments }}"
|
|
|
|
insertbefore: BOF
|
|
|
|
notify: restart alertmanager
|
|
|
|
|
|
|
|
- name: render alertmanager config template
|
2021-11-03 02:25:21 +01:00
|
|
|
ansible.builtin.template:
|
2020-11-13 10:36:46 +01:00
|
|
|
src: alertmanager.yml.j2
|
|
|
|
dest: /etc/prometheus/alertmanager.yml
|
|
|
|
owner: root
|
|
|
|
group: prometheus
|
|
|
|
mode: 0640
|
|
|
|
validate: /usr/bin/amtool check-config %s
|
|
|
|
notify: reload alertmanager
|
|
|
|
|
|
|
|
- name: render alertmanager notification templates
|
2021-11-03 02:25:21 +01:00
|
|
|
ansible.builtin.copy:
|
2020-11-13 10:36:46 +01:00
|
|
|
content: "{{ item.content }}"
|
|
|
|
dest: "{{ item.path }}"
|
|
|
|
owner: root
|
|
|
|
group: prometheus
|
|
|
|
mode: 0640
|
|
|
|
loop: "{{ notification_templates }}"
|
|
|
|
notify: reload alertmanager
|