r/alertmanager: Deploy AlertManager

*AlertManager* is the component of the Prometheus ecosystem responsible
for sending alert notifications.
btop
Dustin 2022-08-10 19:44:32 -05:00
parent 1e14dd7905
commit 0dab3afc85
4 changed files with 50 additions and 0 deletions

3
alertmanager.yml Normal file
View File

@ -0,0 +1,3 @@
- hosts: alertmanager
roles:
- alertmanager

View File

@ -0,0 +1,4 @@
- name: reload alertmanager
service:
name: alertmanager
state: reloaded

View File

@ -0,0 +1,36 @@
- 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

View File

@ -0,0 +1,7 @@
- block:
# - import_tasks: install.yml
# tags:
# - install
- import_tasks: deploy.yml
tags:
- alertmanager