1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-10-23 03:46:59 +02:00
ansible-collection-prometheus/roles/prometheus/tasks/flush.yml

42 lines
929 B
YAML
Raw Normal View History

2020-11-13 10:36:46 +01:00
---
- name: enable prometheus admin api
lineinfile:
path: /etc/default/prometheus
regexp: "^ARGS=.*$"
line: >-
ARGS="--query.lookback-delta={{ prometheus_lookback_delta }} --web.enable-admin-api --web.listen-address=127.0.0.1:9090"
insertbefore: BOF
notify: restart prometheus
- name: flush handlers
meta: flush_handlers
- name: wait
pause:
seconds: 15
- name: clear prometheus time series database
uri:
url: http://127.0.0.1:9090/api/v1/admin/tsdb/delete_series?match[]=%7B__name__%3D~%22.%2B%22%7D
method: POST
status_code:
- 200
- 204
- name: wait
pause:
seconds: 5
- name: disable prometheus admin api
lineinfile:
path: /etc/default/prometheus
regexp: "^ARGS=.*$"
line: >-
ARGS="--query.lookback-delta={{ prometheus_lookback_delta }}"
insertbefore: BOF
notify: restart prometheus
- name: flush handlers
meta: flush_handlers