fix: add udev rules

This commit is contained in:
vincent 2024-02-24 16:58:38 +01:00
parent 2727c102b9
commit 7cda1e26c3
3 changed files with 21 additions and 2 deletions

View File

@ -27,3 +27,6 @@ nut_upsmon_extra: |
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5
nut_manufacturer_id: "0463"
nut_product_id: ffff

View File

@ -3,7 +3,8 @@
#
- name: Install Nut
ansible.builtin.package:
name: {{ nut_package_name }}
name:
- "{{ nut_package_name }}"
state: present
@ -31,6 +32,21 @@
group: nut
mode: 640
- name: Create udev rules
ansible.builtin.template:
src: udev/50-ups.rules.j2
dest: /etc/udev/rules.d/50-ups.rules
owner: root
group: root
mode: 640
- name: start and enable nut-driver-enumerator
ansible.builtin.service:
name: nut-driver-enumerator.service
state: started
enabled: true
- name: start and enable nut
ansible.builtin.service:
name: nut.target

View File

@ -1,5 +1,5 @@
{% for ups in nut_ups %}
MONITOR {{ ups.name }}@localhost
MONITOR {{ ups.name }}@localhost 1
{% endfor %}