2018-07-19 16:29:44 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Install prometheus
|
2019-10-07 15:36:50 +02:00
|
|
|
apt: name=prometheus
|
2018-07-19 16:29:44 +02:00
|
|
|
|
2020-05-24 18:25:23 +02:00
|
|
|
- name: Install dependencies
|
|
|
|
apt:
|
|
|
|
name:
|
2023-07-04 13:13:01 +02:00
|
|
|
- python3-pip
|
2020-05-24 18:25:23 +02:00
|
|
|
- python3-setuptools
|
|
|
|
- virtualenv
|
|
|
|
|
|
|
|
- name: Install prometheus-pve-exporter
|
|
|
|
pip:
|
|
|
|
name: git+https://github.com/znerol/prometheus-pve-exporter
|
|
|
|
virtualenv: /opt/prometheus-pve-exporter
|
|
|
|
virtualenv_python: python3
|
|
|
|
|
|
|
|
- name: Systemd unit for prometheus-pve-exporter
|
|
|
|
copy: src=prometheus-pve-exporter.service dest=/etc/systemd/system/prometheus-pve-exporter.service
|
|
|
|
notify:
|
|
|
|
- Reload systemd
|
|
|
|
- Restart prometheus-pve-exporter
|
|
|
|
|
2021-08-31 19:09:12 +02:00
|
|
|
- name: Configure prometheus retention
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/default/prometheus
|
|
|
|
regexp: '^ARGS=.*$'
|
|
|
|
line: 'ARGS="--storage.tsdb.retention.time=365d"'
|
|
|
|
notify: Restart prometheus
|
|
|
|
|
2018-07-19 16:29:44 +02:00
|
|
|
- name: Configure prometheus
|
|
|
|
template: src=prometheus.yml.j2 dest=/etc/prometheus/prometheus.yml
|
|
|
|
notify: Restart prometheus
|
|
|
|
|
2020-05-24 18:25:23 +02:00
|
|
|
- name: Configure prometheus-pve-exporter
|
|
|
|
template: src=pve.yml.j2 dest=/etc/prometheus/pve.yml
|
|
|
|
notify: Restart prometheus-pve-exporter
|
|
|
|
|
2018-07-19 16:29:44 +02:00
|
|
|
- name: Enable prometheus
|
2018-07-26 10:57:58 +02:00
|
|
|
service: name=prometheus state=started enabled=yes
|
2020-05-24 18:25:23 +02:00
|
|
|
|
|
|
|
- name: Enable prometheus-pve-exporter
|
|
|
|
service: name=prometheus-pve-exporter state=started enabled=yes
|