feat: adjustments to nut
parent
86e438b6b8
commit
be84734ee6
|
@ -206,6 +206,7 @@ all:
|
|||
serial: "GBULZ2000030"
|
||||
vendor: "CPS"
|
||||
bus: "001"
|
||||
pollinterval: 15
|
||||
|
||||
nut_mode: netserver
|
||||
nut_admin_password: !vault |
|
||||
|
|
|
@ -6,12 +6,18 @@
|
|||
- nut-server
|
||||
when: ansible_distribution in ["Debian", "Ubuntu"]
|
||||
|
||||
- name: "set MAXAGE to 25 in /etc/nut/upsd.conf"
|
||||
lineinfile:
|
||||
dest: /etc/nut/upsd.conf
|
||||
regexp: '^#\s*MAXAGE.*$'
|
||||
line: 'MAXAGE 25'
|
||||
|
||||
- name: add UPS device(s) config to /etc/nut/ups.conf
|
||||
blockinfile:
|
||||
path: /etc/nut/ups.conf
|
||||
block: |
|
||||
[{{ nut_device.name }}]
|
||||
{% for key, value in nut_device.config.items() %} {{ key }} = "{{ value }}"
|
||||
{% for key, value in nut_device.config.items() %} {{ key }} = {{ value | to_json }}
|
||||
{% endfor %}
|
||||
|
||||
- name: set up NUT user(s) to /etc/nut/upsd.users
|
||||
|
|
|
@ -11,6 +11,12 @@
|
|||
block: |
|
||||
MONITOR {{ nut_device.name }}@{{ nut_host }} 1 upsmon {{ nut_upsmon_password }} {{ nut_types[nut_mode] }}
|
||||
|
||||
- name: "set DEADTIME to 25 in /etc/nut/upsmon.conf"
|
||||
lineinfile:
|
||||
dest: /etc/nut/upsmon.conf
|
||||
regexp: 'DEADTIME.*$'
|
||||
line: 'DEADTIME 25'
|
||||
|
||||
- name: start and enable nut-upsmon with openrc
|
||||
service:
|
||||
name: nut-upsmon
|
||||
|
|
Loading…
Reference in New Issue