nut: Add playbook for NUT

NUT runs on *serial0.pyrocufflink.blue* and monitors the two UPSes on
the server rack.
ntfy
Dustin 2021-10-31 14:28:27 -05:00
parent ff7c58ae71
commit c882ac45e7
4 changed files with 48 additions and 0 deletions

28
group_vars/nut/main.yml Normal file
View File

@ -0,0 +1,28 @@
nut_users:
homeassistant:
- password: '{{ vault_nut_user_passwords.homeassistant }}'
nut_ups:
apc1500:
- driver: usbhid-ups
- port: auto
- desc: Back-UPS XS 1500G
- vendorid: 051d
- product: .*1500G.*
- pollonly: enabled
- pollinterval: 1
apc1300:
- driver: usbhid-ups
- port: auto
- desc: Back-UPS XS 1300G
- vendorid: 051d
- product: .*1300G.*
- pollonly: enabled
- pollinterval: 1
collectd_nut_ups: >-
{{
["localhost"]
| product(nut_ups.keys())
| map("reverse")
| map("join", "@")
| list
}}

9
group_vars/nut/secrets Normal file
View File

@ -0,0 +1,9 @@
$ANSIBLE_VAULT;1.1;AES256
66336466336337363633626434626631303037636164383464666630653831323638306234666139
3766656566376662313363393665366436643533643337620a323964376430313764393935316131
35613030623261353136376638396638383634346237333337303164383935303332366264376535
6664366136366439300a303931396464353363333562623366663063303562303935323361346335
65383263376637653539616430306334383637303963323831616632643736333266356661663337
31383436393137333136323764366334643939643934383135343730316135313739373863643062
38386136396638323465316161633239323033323336623039633765393865306462313464626563
33616561666631386437

3
hosts
View File

@ -74,6 +74,9 @@ cloud0.pyrocufflink.blue
[ntpd] [ntpd]
dc0.pyrocufflink.blue dc0.pyrocufflink.blue
[nut]
serial0.pyrocufflink.blue
[postgresql] [postgresql]
cloud0.pyrocufflink.blue cloud0.pyrocufflink.blue

8
nut.yml Normal file
View File

@ -0,0 +1,8 @@
- hosts: nut
roles:
- role: nut
tags:
- nut
- role: collectd-nut
tags:
- collectd