From cc1a43322e9553f99aee2086c4fbc2b133388ac5 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Wed, 25 Jan 2023 18:15:16 +0100 Subject: [PATCH] nut LISTEN ip --- hosts.yml | 2 -- roles/nut/tasks/upsd.yml | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hosts.yml b/hosts.yml index 0f8a837..0d5de83 100644 --- a/hosts.yml +++ b/hosts.yml @@ -223,8 +223,6 @@ all: nut_host: localhost - nut_listen: "10.0.0.0/24" - caladan: ansible_host: caladan ansible_user: ansible diff --git a/roles/nut/tasks/upsd.yml b/roles/nut/tasks/upsd.yml index 654bea7..6e80831 100644 --- a/roles/nut/tasks/upsd.yml +++ b/roles/nut/tasks/upsd.yml @@ -27,11 +27,13 @@ password = "{{ nut_upsmon_password }}" upsmon {{ nut_types[nut_mode] }} -- name: add LISTEN line to /etc/nut/upsd.conf - lineinfile: +- name: allow NUT to listen to all IPs + blockinfile: path: /etc/nut/upsd.conf - regexp: '^LISTEN' - line: "LISTEN {{ nut_listen }}" + block: | + LISTEN 0.0.0.0 + LISTEN ::1 + when: nut_mode == "netserver" - name: start and enable nut-upsd service: