ansible/roles/nut/tasks/main.yml

27 lines
555 B
YAML
Raw Normal View History

2023-01-25 10:53:02 +01:00
---
- name: install NUT for alpine
apk:
name:
- nut
when: ansible_distribution == "Alpine"
- name: set NUT mode
lineinfile:
path: /etc/nut/nut.conf
regexp: '^MODE='
line: "MODE={{ nut_mode }}"
- name: set up /etc/nut/upsmon.conf
blockinfile:
path: /etc/nut/upsmon.conf
block: |
MONITOR {{ nut_device.name }} 1 {{ nut_upsmon_password }} {{ nut_types[nut_mode] }}
- name: set up upsd
include_tasks: upsd.yml
when: nut_mode in ["standalone", "netserver"]
- name: set up upsmon
include_tasks: upsmon.yml