Role: nut¶
Network UPS Tools (server + client) — monitors the CyberPower PR1500ERT2U and triggers a graceful shutdown on battery-low.
Hosts: proxfold
Tasks¶
| Task | Tag |
|---|---|
Install nut, nut-server, nut-client |
nut, install |
Render /etc/nut/nut.conf |
nut, config |
Render /etc/nut/ups.conf |
nut, config |
Render /etc/nut/upsd.conf |
nut, config |
Render /etc/nut/upsd.users (no_log) |
nut, config |
Render /etc/nut/upsmon.conf (no_log) |
nut, config |
Enable and start nut-server |
nut, service |
Enable and start nut-monitor |
nut, service |
Key variables¶
| Variable | Source | Value on proxfold |
|---|---|---|
nut_mode |
defaults → host_vars | standalone (server + monitor on same host) |
nut_listen_addresses |
defaults | [127.0.0.1, ::1] |
nut_listen_port |
defaults | 3493 |
nut_upses |
proxfold host_vars | [{name: cyberpower, driver: usbhid-ups, port: auto, vendorid: "0764", productid: "0601"}] |
nut_monitor_ups |
proxfold host_vars | cyberpower |
nut_monitor_user |
defaults | upsmon |
nut_shutdown_cmd |
defaults | /sbin/shutdown -h +0 |
nut_pollfreq / nut_pollfreq_alert |
defaults | 5 / 5 seconds |
nut_hostsync / nut_deadtime |
defaults | 15 / 15 seconds |
nut_rbwarntime |
defaults | 43200 (battery replace warning, seconds) |
nut_nocommwarntime |
defaults | 300 (no-communication warning) |
vault_nut_admin_password |
vault | upsd.users admin account |
vault_nut_upsmon_password |
vault | upsmon monitor password |
Templates¶
| Template | Deploys to | Permissions |
|---|---|---|
nut.conf.j2 |
/etc/nut/nut.conf |
0640 root:nut |
ups.conf.j2 |
/etc/nut/ups.conf |
0640 root:nut |
upsd.conf.j2 |
/etc/nut/upsd.conf |
0640 root:nut |
upsd.users.j2 |
/etc/nut/upsd.users |
0640 root:nut (no_log) |
upsmon.conf.j2 |
/etc/nut/upsmon.conf |
0640 root:nut (no_log) |
Handlers¶
restart nut-server— fires on anynut.conf,ups.conf,upsd.conf, orupsd.userschangerestart nut-monitor— fires onnut.conforupsmon.confchange
Hardware reference¶
CyberPower PR1500ERT2U reports as USB HID device 0764:0601. The usbhid-ups driver auto-detects the port. If the UPS moves to a different port, no config change is needed — leave port: auto.
Related¶
- proxfold — UPS page
- Variables & Vault — lists
vault_nut_*entries