From c882ac45e72f3edbcf50684c50ad6e569e951eea Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 31 Oct 2021 14:28:27 -0500 Subject: [PATCH] nut: Add playbook for NUT NUT runs on *serial0.pyrocufflink.blue* and monitors the two UPSes on the server rack. --- group_vars/nut/main.yml | 28 ++++++++++++++++++++++++++++ group_vars/nut/secrets | 9 +++++++++ hosts | 3 +++ nut.yml | 8 ++++++++ 4 files changed, 48 insertions(+) create mode 100644 group_vars/nut/main.yml create mode 100644 group_vars/nut/secrets create mode 100644 nut.yml diff --git a/group_vars/nut/main.yml b/group_vars/nut/main.yml new file mode 100644 index 0000000..1fb426d --- /dev/null +++ b/group_vars/nut/main.yml @@ -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 + }} diff --git a/group_vars/nut/secrets b/group_vars/nut/secrets new file mode 100644 index 0000000..360e0fa --- /dev/null +++ b/group_vars/nut/secrets @@ -0,0 +1,9 @@ +$ANSIBLE_VAULT;1.1;AES256 +66336466336337363633626434626631303037636164383464666630653831323638306234666139 +3766656566376662313363393665366436643533643337620a323964376430313764393935316131 +35613030623261353136376638396638383634346237333337303164383935303332366264376535 +6664366136366439300a303931396464353363333562623366663063303562303935323361346335 +65383263376637653539616430306334383637303963323831616632643736333266356661663337 +31383436393137333136323764366334643939643934383135343730316135313739373863643062 +38386136396638323465316161633239323033323336623039633765393865306462313464626563 +33616561666631386437 diff --git a/hosts b/hosts index 97e2df8..149c630 100644 --- a/hosts +++ b/hosts @@ -74,6 +74,9 @@ cloud0.pyrocufflink.blue [ntpd] dc0.pyrocufflink.blue +[nut] +serial0.pyrocufflink.blue + [postgresql] cloud0.pyrocufflink.blue diff --git a/nut.yml b/nut.yml new file mode 100644 index 0000000..713f84a --- /dev/null +++ b/nut.yml @@ -0,0 +1,8 @@ +- hosts: nut + roles: + - role: nut + tags: + - nut + - role: collectd-nut + tags: + - collectd