--- - 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