Compare commits

...

2 Commits

Author SHA1 Message Date
Ricard Illa 3dfb5d7c5a
feat: add btrbk to cron 2023-04-10 21:25:41 +02:00
Ricard Illa be84734ee6
feat: adjustments to nut 2023-04-10 21:25:17 +02:00
4 changed files with 22 additions and 1 deletions

View File

@ -206,6 +206,7 @@ all:
serial: "GBULZ2000030"
vendor: "CPS"
bus: "001"
pollinterval: 15
nut_mode: netserver
nut_admin_password: !vault |

View File

@ -37,6 +37,14 @@
owner: btrbk
mode: '0644'
- name: add btrbk to cron
cron:
name: btrbk
special_time: daily
user: btrbk
job: "btrbk run"
- name: add btrbk files to lbu
lbu:
include:

View File

@ -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

View File

@ -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