diff --git a/hosts.yml b/hosts.yml index 0d5de83..0f8a837 100644 --- a/hosts.yml +++ b/hosts.yml @@ -223,6 +223,8 @@ 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 4acfeb9..654bea7 100644 --- a/roles/nut/tasks/upsd.yml +++ b/roles/nut/tasks/upsd.yml @@ -27,6 +27,12 @@ password = "{{ nut_upsmon_password }}" upsmon {{ nut_types[nut_mode] }} +- name: add LISTEN line to /etc/nut/upsd.conf + lineinfile: + path: /etc/nut/upsd.conf + regexp: '^LISTEN' + line: "LISTEN {{ nut_listen }}" + - name: start and enable nut-upsd service: name: nut-upsd