Expanded the UPS_monitoring to install NUT and configure the options. Port not yet accessible.

This commit is contained in:
Pet
2018-02-11 17:55:26 +01:00
parent 013152e80e
commit 2b621ed364
10 changed files with 118 additions and 1 deletions

View File

@@ -2,6 +2,10 @@ all:
children: children:
fet: fet:
hosts: hosts:
ariane ariane:
lxc-pet-01:
fet_container:
hosts:
lxc-pet-01
vars: vars:
ansible_python_interpreter=/usr/bin/python3 ansible_python_interpreter=/usr/bin/python3

2
hosts/production_pet Normal file
View File

@@ -0,0 +1,2 @@
[fet_container]
lxc-pet-01

View File

@@ -0,0 +1,4 @@
#This file is written by ansible. Manual changes will be reverted. 2.2018, pet
KERNEL=="ttyS0", GROUP="nut"

View File

@@ -0,0 +1,4 @@
#This file is written by ansible. Manual changes will be reverted. 2.2018, pet
#This is the master server for the UPS, all others should be netclient.
MODE=netserver

View File

@@ -0,0 +1,6 @@
#This file is written by ansible. Manual changes will be reverted. 2.2018, pet
[VSD1500]
driver = riello_ser
port = /dev/ttyS1
desc = "Riello VSD 1500; RS-Components: 869-5016; bought: 1.2018"

View File

@@ -0,0 +1,4 @@
#This file is written by ansible. Manual changes will be reverted. 2.2018, pet
LISTEN 192.168.86.116 3493
LISTEN 127.0.0.1 3493

View File

@@ -0,0 +1,10 @@
#This file is written by ansible. Manual changes will be reverted. 2.2018, pet
[monmaster]
password = DorsAz4BK7XiMKDfPj
upsmon master
[monuser]
password = sEfguPcZbn99qnnTUj
upsmon slave

View File

@@ -0,0 +1,3 @@
#This file is written by ansible. Manual changes will be reverted. 2.2018, pet
MONITOR VSD1500@lxc-pet-01 1 monmaster DorsAz4BK7XiMKDfPj master

View File

@@ -0,0 +1,70 @@
- name: Check NUT (Network UPS Tools) installation
apt:
update_cache: yes
name: nut
- name: NUT mode - /etc/nut/nut.conf
copy:
dest: /etc/nut/nut.conf
src: nut.conf
owner: root
group: nut
mode: 0640
backup: yes
- name: UPS conf - /etc/nut/ups.conf
copy:
dest: /etc/nut/ups.conf
src: ups.conf
owner: root
group: nut
mode: 0640
backup: yes
- name: UPS ip:port - /etc/nut/upsd.conf
copy:
dest: /etc/nut/upsd.conf
src: upsd.conf
owner: root
group: nut
mode: 0640
backup: yes
- name: NUT user - /etc/nut/upsd.users
copy:
dest: /etc/nut/upsd.users
src: upsd.users
owner: root
group: nut
mode: 0640
backup: yes
- name: NUT monitoring - /etc/nut/upsmon.conf
copy:
dest: /etc/nut/upsmon.conf
src: upsmon.conf
owner: root
group: nut
mode: 0640
backup: yes
#- name: Serial port configuration- /etc/udev/rules.d/99_nut-serialups.rules
# copy:
# dest: /etc/udev/rules.d/99_nut-serialups.rules
# src: 99_nut-serialups.rules
# owner: root
# group: nut
# mode: 0640
# backup: yes
#
#- name: Force udev to reload Serialports
# command: "udevadm control --reload-rules"
#
#- name: Force udev to reload Serialports
# command: "udevadm trigger"
- name: Stop the upsd
command: "upsd -c stop"
- name: Start the upsd
command: upsd

View File

@@ -25,6 +25,8 @@
- hosts: all - hosts: all
gather_facts: False gather_facts: False
tasks: tasks:
- name: install python
raw: test -e /usr/bin/python || (apt-get update && apt-get install -y python)
- name: install python3 - name: install python3
raw: test -e /usr/bin/python3 || (apt-get update && apt-get install -y python3) raw: test -e /usr/bin/python3 || (apt-get update && apt-get install -y python3)
@@ -33,3 +35,11 @@
- common - common
# - rvm1-ansible # - rvm1-ansible
- ariane - ariane
- hosts: fet
roles:
- common
- hosts: lxc-pet-01
roles:
- USV_monitoring