forked from infra/ansible
prometheus: add retention setting
This commit is contained in:
parent
a09942a01e
commit
35794adb90
@ -1,9 +1,5 @@
|
||||
---
|
||||
|
||||
- name: Check OS release
|
||||
fail: msg="This role is only supported on Debian buster"
|
||||
when: not (ansible_distribution == 'Debian' and ansible_distribution_release == 'buster')
|
||||
|
||||
- name: Install prometheus
|
||||
apt: name=prometheus
|
||||
|
||||
@ -25,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
|
||||
|
Loading…
Reference in New Issue
Block a user