mirror of
https://github.com/RWejlgaard/pez-infra.git
synced 2026-05-06 04:14:43 +00:00
fix: prometheus retention time
This commit is contained in:
parent
b82013c2f0
commit
2f808b6ffe
4 changed files with 16 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
2
ansible/roles/prometheus/defaults/main.yml
Normal file
2
ansible/roles/prometheus/defaults/main.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
prometheus_retention_time: "1y"
|
||||
5
ansible/roles/prometheus/handlers/main.yml
Normal file
5
ansible/roles/prometheus/handlers/main.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: Restart prometheus
|
||||
ansible.builtin.service:
|
||||
name: prometheus
|
||||
state: restarted
|
||||
7
ansible/roles/prometheus/tasks/main.yml
Normal file
7
ansible/roles/prometheus/tasks/main.yml
Normal 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
|
||||
Loading…
Add table
Reference in a new issue