Feat: enabe netserver for nut

This commit is contained in:
Bertrand Benjamin 2022-12-03 10:06:05 +01:00
parent 38c4291b90
commit 558530e16e
4 changed files with 27 additions and 1 deletions

View File

@ -1,2 +1,8 @@
--- ---
# defaults file for nut # defaults file for nut
nut_mode: "standalone"
upss:
- name: fooUps
driver: usbhid-ups
port: auto

View File

@ -7,7 +7,7 @@
lineinfile: lineinfile:
path: /etc/nut/nut.conf path: /etc/nut/nut.conf
regexp: '^MODE=' regexp: '^MODE='
line: MODE=standalone line: MODE=netserver
notify: restart nut-server notify: restart nut-server
- name: Copy ups.conf - name: Copy ups.conf
@ -18,3 +18,12 @@
group: root group: root
mode: 0644 mode: 0644
notify: restart nut-server notify: restart nut-server
- name: Copy upsd.conf
template:
src: upsd.conf.j2
dest: /etc/nut/upsd.conf
owner: root
group: root
mode: 0644
notify: restart nut-server

View File

@ -0,0 +1,7 @@
MAXAGE 3
{% if nut_mode == "standalone" %}
LISTEN 127.0.0.1 3493
{% else %}
LISTEN 0.0.0.0 3493
{% endif %}
MAXCONN 2

View File

@ -13,10 +13,14 @@ pihole_docker_image: pihole/pihole:2022.05
pihole_ip: 192.168.2.202 pihole_ip: 192.168.2.202
# Nut # Nut
nut_mode: "netserver"
upss: upss:
- name: eaton650 - name: eaton650
driver: usbhid-ups driver: usbhid-ups
port: auto port: auto
vendorid: "0463"
poductid: "FFFF"
desc: "UPS bureau"
# minidlna # minidlna
minidlna_friendly_name: "Nas dlna" minidlna_friendly_name: "Nas dlna"