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:
35
roles/nut-monitor/tasks/main.yml
Normal file
35
roles/nut-monitor/tasks/main.yml
Normal 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
|
||||
Reference in New Issue
Block a user