From c196bc44830373728a5a6f2648e15a3d56ab2ecd Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Tue, 31 Aug 2021 19:09:12 +0200 Subject: [PATCH] prometheus: add retention setting --- roles/prometheus/tasks/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/prometheus/tasks/main.yml b/roles/prometheus/tasks/main.yml index faa2296..e3bbec8 100644 --- a/roles/prometheus/tasks/main.yml +++ b/roles/prometheus/tasks/main.yml @@ -21,6 +21,13 @@ - Reload systemd - Restart prometheus-pve-exporter +- name: Configure prometheus retention + lineinfile: + path: /etc/default/prometheus + regexp: '^ARGS=.*$' + line: 'ARGS="--storage.tsdb.retention.time=365d"' + notify: Restart prometheus + - name: Configure prometheus template: src=prometheus.yml.j2 dest=/etc/prometheus/prometheus.yml notify: Restart prometheus