2021-09-05 21:32:21 +02:00
|
|
|
---
|
|
|
|
- name: Install Prometheus Components
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- prometheus
|
|
|
|
- prometheus-alertmanager
|
|
|
|
- prometheus-pushgateway
|
|
|
|
state: latest
|
|
|
|
update_cache: true
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2021-09-05 22:02:48 +02:00
|
|
|
|
|
|
|
- name: Ensure the alert folder exist
|
|
|
|
file:
|
|
|
|
path: /etc/prometheus/alerts
|
|
|
|
state: directory
|
|
|
|
group: prometheus
|
|
|
|
owner: prometheus
|
|
|
|
mode: u=rwx,g=rx,o=rx
|
|
|
|
|
|
|
|
- name: Setup the prometheus config
|
|
|
|
template:
|
|
|
|
src: prometheus.yml
|
|
|
|
dest: /etc/prometheus/prometheus.yml
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: '0640'
|
2021-09-06 00:30:05 +02:00
|
|
|
notify: Restart prometheus
|
2021-09-05 22:02:48 +02:00
|
|
|
no_log: true
|
|
|
|
|
|
|
|
|