prometheus: allow setting custom retention time

15 days is default and also too short.
This commit is contained in:
Timotej Lazar 2025-11-04 14:18:56 +01:00
parent 5ba04824f1
commit be7eca3a89
3 changed files with 15 additions and 1 deletions

View file

@ -8,6 +8,14 @@
path: /etc/prometheus/conf.d
state: directory
- name: Configure prometheus retention time
when: retention is defined
lineinfile:
path: /etc/conf.d/prometheus
regexp: "^prometheus_retention_time="
line: "prometheus_retention_time={{ retention }}"
notify: restart prometheus
- name: Configure prometheus
copy:
dest: /etc/prometheus/