nut-monitor: Configure upsmon

`upsmon` is the component of [NUT] that monitors (local or remote) UPS
devices and reacts to changes in their state.  Notably, it is
responsible for powering down the system when there is insufficient
power to the system.
This commit is contained in:
2024-01-19 20:47:51 -06:00
parent f31018f514
commit 525f2b2a04
8 changed files with 542 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
- name: ensure nut-client is installed
package:
name: nut-client
state: present
tags:
- install
- name: ensure upsmon is configured
template:
src: upsmon.conf.j2
dest: /etc/ups/upsmon.conf
owner: root
group: nut
mode: u=rw,g=r,o=
notify:
- restart nut-monitor
tags:
- config
- name: flush handlers
meta: flush_handlers
- name: ensure nut-monitor is running
service:
name: nut-monitor
state: started
tags:
- service
- name: ensure nut-monitor starts at boot
service:
name: nut-monitor
enabled: true
tags:
- service