2023-01-25 10:53:02 +01:00
|
|
|
---
|
|
|
|
|
2023-01-25 15:55:20 +01:00
|
|
|
- name: install NUT for Alpine
|
2023-01-25 10:53:02 +01:00
|
|
|
apk:
|
2023-01-25 15:55:20 +01:00
|
|
|
name: nut
|
2023-01-25 10:53:02 +01:00
|
|
|
when: ansible_distribution == "Alpine"
|
|
|
|
|
2023-01-25 15:55:20 +01:00
|
|
|
- name: keep nut-server uninstalled from Debian/Ubuntu in client mode
|
|
|
|
apt:
|
|
|
|
name: nut-server
|
|
|
|
state: absent
|
|
|
|
when: ansible_distribution in ["Debian", "Ubuntu"] and nut_mode == "netclient"
|
|
|
|
|
2023-01-25 10:53:02 +01:00
|
|
|
- name: set NUT mode
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/nut/nut.conf
|
|
|
|
regexp: '^MODE='
|
|
|
|
line: "MODE={{ nut_mode }}"
|
|
|
|
|
|
|
|
- name: set up upsd
|
|
|
|
include_tasks: upsd.yml
|
|
|
|
when: nut_mode in ["standalone", "netserver"]
|
|
|
|
|
|
|
|
- name: set up upsmon
|
|
|
|
include_tasks: upsmon.yml
|