ansible/roles/nut/tasks/main.yml

29 lines
576 B
YAML

---
- name: install NUT for Alpine
apk:
name: nut
when: ansible_distribution == "Alpine"
- name: install NUT for Arch
pacman:
name: nut
when: ansible_distribution == "Archlinux"
- name: set NUT mode
lineinfile:
path: /etc/nut/nut.conf
regexp: '^MODE='
line: "MODE={{ nut_mode }}"
- name: prevent nut-server when using netclient mode
include_tasks: netclient.yml
when: nut_mode == "netclient"
- name: set up upsd
include_tasks: upsd.yml
when: nut_mode in ["standalone", "netserver"]
- name: set up upsmon
include_tasks: upsmon.yml