Feat: ajoute nut au nas
This commit is contained in:
parent
020e81176d
commit
37040f843c
18
home.yml
18
home.yml
@ -33,14 +33,17 @@
|
||||
# - name: Secure ssh
|
||||
# include_role:
|
||||
# name: ssh
|
||||
|
||||
- name: Set up nfs network shares server
|
||||
- name: Set up nuts
|
||||
include_role:
|
||||
name: nfs_server
|
||||
name: nut
|
||||
|
||||
- name: Set up samba network shares
|
||||
include_role:
|
||||
name: samba_server
|
||||
# - name: Set up nfs network shares server
|
||||
# include_role:
|
||||
# name: nfs_server
|
||||
|
||||
# - name: Set up samba network shares
|
||||
# include_role:
|
||||
# name: samba_server
|
||||
|
||||
- name: Install docker
|
||||
debug:
|
||||
@ -54,9 +57,6 @@
|
||||
debug:
|
||||
msg: Todo
|
||||
|
||||
- name: Set up nuts
|
||||
debug:
|
||||
msg: Todo
|
||||
|
||||
#- name: Set up collectd
|
||||
# include_role:
|
||||
|
2
roles/nut/defaults/main.yml
Normal file
2
roles/nut/defaults/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# defaults file for nut
|
6
roles/nut/handlers/main.yml
Normal file
6
roles/nut/handlers/main.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
# handlers file for nut
|
||||
- name: restart nut-server
|
||||
service:
|
||||
name: nut-server
|
||||
state: restarted
|
6
roles/nut/tasks/debian.yml
Normal file
6
roles/nut/tasks/debian.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: Debian - Install nut
|
||||
apt:
|
||||
name:
|
||||
- nut
|
||||
state: present
|
21
roles/nut/tasks/main.yml
Normal file
21
roles/nut/tasks/main.yml
Normal 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
|
||||
|
7
roles/nut/templates/ups.conf.j2
Normal file
7
roles/nut/templates/ups.conf.j2
Normal file
@ -0,0 +1,7 @@
|
||||
maxretry = 3
|
||||
|
||||
{% for ups in upss %}
|
||||
[{{ ups.name }}]
|
||||
driver = {{ ups.driver }}
|
||||
port = {{ ups.port }}
|
||||
{% endfor %}
|
2
roles/nut/vars/main.yml
Normal file
2
roles/nut/vars/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
# vars file for nut
|
@ -1 +1,5 @@
|
||||
---
|
||||
upss:
|
||||
- name: eaton650
|
||||
driver: usbhid-ups
|
||||
port: auto
|
||||
|
Loading…
Reference in New Issue
Block a user