Add monitoring role

This commit is contained in:
polyfloyd 2023-09-24 15:26:04 +02:00
parent dca17d5750
commit d06406c9f4
17 changed files with 539 additions and 0 deletions

View file

@ -0,0 +1,27 @@
---
- name: Install dependencies
apt:
name: prometheus
- name: Configure Prometheus
template:
src: prometheus.yml
dest: "{{ prometheus_config_dir }}/prometheus.yml"
owner: root
group: root
mode: 0644
notify: restart prometheus
- name: Configure Prometheus args
lineinfile:
path: /etc/default/prometheus
line: >-
ARGS="
--storage.tsdb.retention.time={{ prometheus_storage_retention }}
--storage.tsdb.retention.size=0
--web.listen-address={{ prometheus_web_listen_address }}
--web.external-url=prometheus
--config.file={{ prometheus_config_dir }}/prometheus.yml
"
regexp: '^ARGS'
notify: restart prometheus