Files
configpolicy/roles/alertmanager/tasks/deploy.yml
Dustin C. Hatch 0dab3afc85 r/alertmanager: Deploy AlertManager
*AlertManager* is the component of the Prometheus ecosystem responsible
for sending alert notifications.
2022-08-10 22:18:53 -05:00

37 lines
730 B
YAML

- name: ensure prometheus configuration directory exists
file:
path: /etc/prometheus
mode: u=rwx,go=rx
owner: root
group: root
state: directory
tags:
- config
- name: ensure alertmanager is configured
copy:
dest: /etc/prometheus/alertmanager.yml
content: |+
{{ alertmanager_config | to_nice_yaml(indent=2) }}
mode: u=rw,go=r
owner: root
group: root
notify:
- reload alertmanager
tags:
- config
- name: ensure alertmanager starts at boot
service:
name: alertmanager
enabled: true
tags:
- service
- name: flush handlers
meta: flush_handlers
- name: ensure alertmanager is running
service:
name: alertmanager
state: started
tags:
- service