add smartctl_exporter to hypervisors
This commit is contained in:
parent
0daa626819
commit
c0a8ceefc6
4 changed files with 45 additions and 0 deletions
|
@ -5,3 +5,8 @@
|
|||
service:
|
||||
name: apcupsd_exporter
|
||||
state: restarted
|
||||
|
||||
- name: restart smartctl_exporter
|
||||
service:
|
||||
name: smartctl_exporter
|
||||
state: restarted
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
- include_tasks: ups.yaml
|
||||
- include_tasks: smartmontools.yaml
|
||||
|
|
27
roles/hypervisor/tasks/smartmontools.yaml
Normal file
27
roles/hypervisor/tasks/smartmontools.yaml
Normal 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
|
12
roles/hypervisor/templates/smartctl_exporter.service
Normal file
12
roles/hypervisor/templates/smartctl_exporter.service
Normal 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
|
Loading…
Reference in a new issue