Ansible_workstation/roles/nut/tasks/main.yml

62 lines
1.2 KiB
YAML

---
# tasks file for nut
- name: Install os-specific packages
include_tasks: "{{ ansible_os_family | lower }}.yml"
- name: Enable standalone mode for Nut
lineinfile:
path: /etc/nut/nut.conf
regexp: '^MODE='
line: MODE=netserver
notify: restart nut-server
# List of connected ups
- name: Copy ups.conf
template:
src: ups.conf.j2
dest: /etc/nut/ups.conf
owner: root
group: root
mode: 0644
notify: restart nut-server
# Service that communicate with UPSs
- name: Copy upsd.conf
template:
src: upsd.conf.j2
dest: /etc/nut/upsd.conf
owner: root
group: root
mode: 0644
notify: restart nut-server
# List of users allowed to communicate with upsd through network
- name: Copy upsd.users
template:
src: upsd.users.j2
dest: /etc/nut/upsd.users
owner: root
group: root
mode: 0644
notify: restart nut-server
# Nut mode
- name: Copy nut.conf
template:
src: nut.conf.j2
dest: /etc/nut/nut.conf
owner: root
group: root
mode: 0644
notify: restart nut-server
# Service that interact with upsd to act
- name: Copy upsmon.conf
template:
src: upsmon.conf.j2
dest: /etc/nut/upsmon.conf
owner: root
group: root
mode: 0644
notify: restart nut-server