add smartctl_exporter to hypervisors

This commit is contained in:
Finn 2024-08-05 00:19:14 -07:00
parent 0daa626819
commit c0a8ceefc6
4 changed files with 45 additions and 0 deletions

View file

@ -5,3 +5,8 @@
service:
name: apcupsd_exporter
state: restarted
- name: restart smartctl_exporter
service:
name: smartctl_exporter
state: restarted

View file

@ -1 +1,2 @@
- include_tasks: ups.yaml
- include_tasks: smartmontools.yaml

View file

@ -0,0 +1,27 @@
- name: Install smartmontools
apt:
name: smartmontools
- name: download smartctl_exporter
get_url:
url: https://git.janky.solutions/api/packages/JankySolutions/generic/infra-smartctl-exporter/0daa62681994c374e0915dbff2125f1bd8693e00/smartctl_exporter
checksum: sha256:01af30f3f46db761b8721dff3dd7517cb5c6d82ae4cd919fbfac0c43d8a78e90
dest: /usr/local/bin/smartctl_exporter
mode: "0755"
notify:
- restart smartctl_exporter
- name: install smartctl_exporter service
template:
src: smartctl_exporter.service
dest: /etc/systemd/system/smartctl_exporter.service
notify:
- systemctl daemon-reload
- restart smartctl_exporter
- meta: flush_handlers
- name: enable smartctl_exporter
service:
name: smartctl_exporter
enabled: true

View file

@ -0,0 +1,12 @@
[Unit]
Description=smartctl prometheus exporter
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/smartctl_exporter
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target