ansible/roles/nut/tasks/main.yml

26 lines
559 B
YAML

---
- name: install NUT for Alpine
apk:
name: nut
when: ansible_distribution == "Alpine"
- 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"
- 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