mirror of
https://gitlab.com/s3lph/ansible-collection-prometheus
synced 2024-10-23 11:56:59 +02:00
44 lines
1,000 B
YAML
44 lines
1,000 B
YAML
---
|
|
|
|
- name: enable prometheus admin api
|
|
ansible.builtin.template:
|
|
src: etc/default/prometheus.j2
|
|
dest: /etc/default/prometheus
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
vars:
|
|
prometheus_additional_arguments:
|
|
"--web.enable-admin-api --web.listen-address=127.0.0.1:9090"
|
|
notify: restart prometheus
|
|
|
|
- name: flush handlers
|
|
ansible.builtin.meta: flush_handlers
|
|
|
|
- name: wait
|
|
ansible.builtin.pause:
|
|
seconds: 15
|
|
|
|
- name: clear prometheus time series database
|
|
ansible.builtin.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
|
|
ansible.builtin.pause:
|
|
seconds: 5
|
|
|
|
- name: disable prometheus admin api
|
|
ansible.builtin.template:
|
|
src: etc/default/prometheus.j2
|
|
dest: /etc/default/prometheus
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
notify: restart prometheus
|
|
|
|
- name: flush handlers
|
|
ansible.builtin.meta: flush_handlers
|