Feat: ajoute nut au nas

This commit is contained in:
2022-06-03 05:39:23 +02:00
parent 020e81176d
commit 37040f843c
8 changed files with 57 additions and 9 deletions

View File

@@ -0,0 +1,6 @@
---
- name: Debian - Install nut
apt:
name:
- nut
state: present

21
roles/nut/tasks/main.yml Normal file
View File

@@ -0,0 +1,21 @@
---
# 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=standalone
notify: restart nut-server
- name: Copy ups.conf
template:
src: ups.conf.j2
dest: /etc/nut/ups.conf
owner: root
group: root
mode: 0644
notify: restart nut-server