ntd.nut
Ansible Role: NUT
This role installs and sets up NUT (Network UPS Tools) on Debian-based systems.
Role Variables
Here are the available variables with their default values (check defaults/main.yml
):
nut_managed_config
: true
If set to false, the configuration files in /etc/nut/
will not be managed by this role, and you will need to take care of them yourself. This is useful for complex setups.
nut_host
: localhostnut_user
: monitornut_password
: Whatever...
These are mainly for configuring the monitor user. In the context of NUT, a user is different from the typical UNIX user.
nut_ups
:- name: UPS
- driver: riello_ups
- device: /dev/ttyUSB0
- description: Some descriptive information
- extra: | maxretry = 10 retrydelay = 1
name
is a unique identifier for the UPS.
driver
is based on your hardware and should be one of the available NUT drivers. Ensure the installed NUT version supports the chosen driver.
device
refers to the port where the UPS connects (like USB or serial).
description
is optional and can be used for notes or debugging.
extra
is optional multi-line text added directly to the main config file.
Other optional variables are:
nut_mode
: standalone # refers to the operating modenut_powervalue
: 1 # for power value settingnut_role
: master # for role typenut_services
: # services to enable- nut-driver
- nut-monitor
- nut-server
Example Playbook
- hosts: all
roles:
- role: ntd.nut
nut_ups:
- name: riello
driver: riello_usb
device: /dev/ups
description: iPlug 800
For more examples, please check tests/test.yml
.
License
MIT
Author Information
This role was created in 2016 by Nicola Fontana (ntd@entidi.it).
ansible-galaxy install ntd.nut