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

45 lines
1,000 B
YAML
Raw Normal View History

2020-11-13 10:36:46 +01:00
---
- name: enable prometheus admin api
2021-11-06 08:48:39 +01:00
ansible.builtin.template:
2021-11-06 05:22:17 +01:00
src: etc/default/prometheus.j2
dest: /etc/default/prometheus
owner: root
group: root
mode: 0644
vars:
prometheus_additional_arguments:
2021-11-06 08:52:41 +01:00
"--web.enable-admin-api --web.listen-address=127.0.0.1:9090"
2020-11-13 10:36:46 +01:00
notify: restart prometheus
- name: flush handlers
ansible.builtin.meta: flush_handlers
2020-11-13 10:36:46 +01:00
- name: wait
ansible.builtin.pause:
2020-11-13 10:36:46 +01:00
seconds: 15
- name: clear prometheus time series database
ansible.builtin.uri:
2020-11-13 10:36:46 +01:00
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
ansible.builtin.pause:
2020-11-13 10:36:46 +01:00
seconds: 5
- name: disable prometheus admin api
2021-11-06 05:22:17 +01:00
ansible.builtin.template:
src: etc/default/prometheus.j2
dest: /etc/default/prometheus
owner: root
group: root
mode: 0644
2020-11-13 10:36:46 +01:00
notify: restart prometheus
- name: flush handlers
ansible.builtin.meta: flush_handlers