feat: adjustments to nut
parent
86e438b6b8
commit
be84734ee6
|
@ -206,6 +206,7 @@ all:
|
||||||
serial: "GBULZ2000030"
|
serial: "GBULZ2000030"
|
||||||
vendor: "CPS"
|
vendor: "CPS"
|
||||||
bus: "001"
|
bus: "001"
|
||||||
|
pollinterval: 15
|
||||||
|
|
||||||
nut_mode: netserver
|
nut_mode: netserver
|
||||||
nut_admin_password: !vault |
|
nut_admin_password: !vault |
|
||||||
|
|
|
@ -6,12 +6,18 @@
|
||||||
- nut-server
|
- nut-server
|
||||||
when: ansible_distribution in ["Debian", "Ubuntu"]
|
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
|
- name: add UPS device(s) config to /etc/nut/ups.conf
|
||||||
blockinfile:
|
blockinfile:
|
||||||
path: /etc/nut/ups.conf
|
path: /etc/nut/ups.conf
|
||||||
block: |
|
block: |
|
||||||
[{{ nut_device.name }}]
|
[{{ 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 %}
|
{% endfor %}
|
||||||
|
|
||||||
- name: set up NUT user(s) to /etc/nut/upsd.users
|
- name: set up NUT user(s) to /etc/nut/upsd.users
|
||||||
|
|
|
@ -11,6 +11,12 @@
|
||||||
block: |
|
block: |
|
||||||
MONITOR {{ nut_device.name }}@{{ nut_host }} 1 upsmon {{ nut_upsmon_password }} {{ nut_types[nut_mode] }}
|
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
|
- name: start and enable nut-upsmon with openrc
|
||||||
service:
|
service:
|
||||||
name: nut-upsmon
|
name: nut-upsmon
|
||||||
|
|
Loading…
Reference in New Issue