Installs and configures Network UPS Tools.
- Chef 12.3.0
- Debian, Ubuntu
Tested on:
- Ubuntu 12.04 (Precise Penguin)
- Ubuntu 14.04 (Trusty Tahr)
Unsupported:
- Ubuntu 13.04
The main attributes are listed below. The complete list is documented in the metadata.rb and attributes/default.rb files included with the project.
node['nut']['mode']
- The mode determines which parts of NUT is to be started (netserver
for the network server,netclient
for a client that connects to the network server,standalone
for running a standalone install)node['nut']['devices']
- Serial devices to change to the NUT groupnode['nut']['ups']
- The driver settings for your UPSnode['nut']['users']
- Determines user access control, authentication and rolesnode['nut']['monitors']
- The monitor configurationnode['nut']['listen']
- Array of ip addresses to listen to. Default only 127.0.0.1
Add the nut recipe to your run list.
knife node run_list add [NODE] 'recipe[nut]'
{
"nut": {
"mode": "standalone",
"devices": ["ttyS0"],
"ups": {
'cyberpower': {
"driver": "powerpanel",
"port": "/dev/ttyS0",
"desc": "Cyberpower CP1500AVR"
}
},
"users": {
"vagrant": {
"password": "vagrant",
"upsmon master": true
}
},
"monitors": {
"cyberpower": {
"system": "cyberpower@localhost",
"power_value": 1,
"username": "vagrant",
"password": "vagrant",
"role": "master"
}
}
}
}
By default upsd listen on 127.0.0.1.
If you want upsd to listen to on other than 127.0.0.1 interface or more that only 127.0.0.1. Override this attribute in a role or environment.
"nut": {
...
"listen": [
"127.0.0.1",
"192.168.1.1"
],
...
}
If upsmon process must run in SLAVE mode, then set node attribute follows: "users": { "vagrant": { "password": "vagrant", "upsmon": "slave" } },
"upsmon master": false IS INVALID attribute in attributes setup.
First you'll need to install [Virtual Box](https://www.virtualbox.org/), [Vagrant](http://vagrantup.com/) and a UPS
mkdir cookbook && ln -s `pwd` cookbooks/nut
vagrant up [precise|trusty]