fix: prometheus retention time

This commit is contained in:
Rasmus Wejlgaard 2026-04-25 20:52:05 +01:00
parent b82013c2f0
commit 2f808b6ffe
4 changed files with 16 additions and 5 deletions

View file

@ -10,6 +10,8 @@
ansible.builtin.include_vars:
file: "{{ playbook_dir }}/../group_vars/all/secrets.yaml"
no_log: true
roles:
- prometheus
tasks:
- name: Deploy Prometheus config
ansible.builtin.template:
@ -77,11 +79,6 @@
notify: Restart grafana
handlers:
- name: Restart prometheus
ansible.builtin.service:
name: prometheus
state: restarted
- name: Restart grafana
ansible.builtin.service:
name: grafana

View file

@ -0,0 +1,2 @@
---
prometheus_retention_time: "1y"

View file

@ -0,0 +1,5 @@
---
- name: Restart prometheus
ansible.builtin.service:
name: prometheus
state: restarted

View file

@ -0,0 +1,7 @@
---
- name: Set Prometheus args in rc.conf (FreeBSD)
community.general.sysrc:
name: prometheus_args
value: "--storage.tsdb.retention.time={{ prometheus_retention_time }}"
when: ansible_facts["os_family"] == "FreeBSD"
notify: Restart prometheus