2024-01-10 07:11:16 -05:00
|
|
|
- name: Template out upsmon.conf
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: upsmon.conf.j2
|
|
|
|
dest: /etc/nut/upsmon.conf
|
|
|
|
trim_blocks: true
|
|
|
|
owner: root
|
|
|
|
group: nut
|
|
|
|
mode: '0640'
|
2024-01-11 00:15:16 -05:00
|
|
|
notify:
|
|
|
|
- Restart nut-monitor
|
|
|
|
|
|
|
|
- name: Ensure nut-monitor systemd drop in directory exists
|
|
|
|
when: not ( nut_client_local_server | default(true) )
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /etc/systemd/system/nut-monitor.service.d
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: '0755'
|
2024-01-10 07:11:16 -05:00
|
|
|
|
|
|
|
- name: Copy nut-monitor systemd drop in file
|
|
|
|
when: not ( nut_client_local_server | default(true) )
|
2024-01-11 00:15:16 -05:00
|
|
|
ansible.builtin.copy:
|
2024-01-10 07:11:16 -05:00
|
|
|
src: nut-monitor_override.conf
|
|
|
|
dest: /etc/systemd/system/nut-monitor.service.d/override.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: '0644'
|
2024-01-11 00:15:16 -05:00
|
|
|
notify:
|
|
|
|
- Restart nut-monitor
|
2024-01-10 07:11:16 -05:00
|
|
|
|
|
|
|
- name: Start and enable nut-monitor
|
|
|
|
ansible.builtin.service:
|
2024-01-11 00:15:16 -05:00
|
|
|
name: nut-monitor.service
|
|
|
|
state: started
|
2024-01-10 07:11:16 -05:00
|
|
|
enabled: true
|
2024-01-11 00:15:16 -05:00
|
|
|
register: nut_monitor_started
|