ansible/roles/nut/tasks/main.yml

29 lines
576 B
YAML
Raw Normal View History

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 17:01:36 +01:00
- name: install NUT for Arch
pacman:
name: nut
when: ansible_distribution == "Archlinux"
2023-01-25 15:55:20 +01:00
2023-01-25 10:53:02 +01:00
- name: set NUT mode
lineinfile:
path: /etc/nut/nut.conf
regexp: '^MODE='
line: "MODE={{ nut_mode }}"
2023-01-25 17:01:36 +01:00
- name: prevent nut-server when using netclient mode
include_tasks: netclient.yml
when: nut_mode == "netclient"
2023-01-25 10:53:02 +01:00
- name: set up upsd
include_tasks: upsd.yml
when: nut_mode in ["standalone", "netserver"]
- name: set up upsmon
include_tasks: upsmon.yml