apcupsd clusterfähig gemacht
This commit is contained in:
parent
8c9f7fa79f
commit
0bea8f7340
13 changed files with 352 additions and 71 deletions
|
@ -111,6 +111,23 @@
|
||||||
- qemu-guest-agent
|
- qemu-guest-agent
|
||||||
- open-vm-tools
|
- open-vm-tools
|
||||||
|
|
||||||
|
### mgrote.apcupsd
|
||||||
|
apcupsd_master_onbatterydelay: 10
|
||||||
|
apcupsd_master_batterylevel_for_shutdown: 50
|
||||||
|
apcupsd_master_minutes_for_shutdown: 10
|
||||||
|
apcupsd_master_nologon_when_active: disable
|
||||||
|
apcupsd_slave_onbatterydelay: 10
|
||||||
|
apcupsd_slave_batterylevel_for_shutdown: 50
|
||||||
|
apcupsd_slave_minutes_for_shutdown: 10
|
||||||
|
apcupsd_slave_nologon_when_active: disable
|
||||||
|
apcupsd_nis_master: on
|
||||||
|
# apcupsd_nis_master_hostname: pve2.grote.lan # wird pro host gesetzt
|
||||||
|
apcupsd_nis_master_listen_ip: 0.0.0.0
|
||||||
|
apcupsd_nis_master_listen_port: 3551
|
||||||
|
apcupsd_ups_name: APC-BX950U-GR
|
||||||
|
# apcupsd_nis_master: false # wird pro host gesetzt
|
||||||
|
|
||||||
|
|
||||||
# Ansible Variablen
|
# Ansible Variablen
|
||||||
### User
|
### User
|
||||||
ansible_user: "ansible-user"
|
ansible_user: "ansible-user"
|
||||||
|
|
|
@ -45,11 +45,6 @@
|
||||||
tmux_conf_destination: "/root/.tmux.conf"
|
tmux_conf_destination: "/root/.tmux.conf"
|
||||||
tmux_bashrc_destination: "/root/.bashrc"
|
tmux_bashrc_destination: "/root/.bashrc"
|
||||||
tmux_standardsession_name: "default"
|
tmux_standardsession_name: "default"
|
||||||
### mgrote.apcupsd
|
|
||||||
ONBATTERYDELAY: 10
|
|
||||||
BATTERYLEVEL: 50
|
|
||||||
MINUTES: 10
|
|
||||||
NOLOGON: disable
|
|
||||||
### mgrote.zfs_tools_cron
|
### mgrote.zfs_tools_cron
|
||||||
zfs_arc_max: "12884901888"
|
zfs_arc_max: "12884901888"
|
||||||
zfs_pools:
|
zfs_pools:
|
||||||
|
|
32
host_vars/pve-test.grote.lan.yml
Normal file
32
host_vars/pve-test.grote.lan.yml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
---
|
||||||
|
### mgrote.zfs_manage_datasets
|
||||||
|
# "Daten"-Datasets verwalte ich händisch!
|
||||||
|
# zfs create -o encryption=aes-256-gcm -o keyformat=passphrase hdd_data_raidz/data_crypt
|
||||||
|
# zfs create hdd_data_raidz/videos
|
||||||
|
# Pools müssen vorher erstellt sein!
|
||||||
|
# SSD_VM_MIRROR
|
||||||
|
# zpool create -f -o ashift=12 ssd_vm_mirror mirror /dev/disk/by-id/ata-ADATA_SU650_2J4420001210 /dev/disk/by-id/ata-ADATA_SU650_2J4420001241
|
||||||
|
# HDD_VM_MIRROR
|
||||||
|
# zpool create -f -o ashift=12 hdd_vm_mirror mirror /dev/disk/by-id/ata-WDC_WD20EACS-11BHUB0_WD-WCAZA3124223 /dev/disk/by-id/ata-WDC_WD20EZRX-00D8PB0_WD-WMC4M1682516 mirror /dev/disk/by-id/ata-WDC_WD30EZRX-00DC0B0_WD-WMC1T3979908 /dev/disk/by-id/ata-TOSHIBA_DT01ACA300_83M2DRAKS
|
||||||
|
# HDD_DATA_RAIDZ
|
||||||
|
# zpool create -f -o ashift=12 hdd_data_raidz raidz /dev/disk/by-id/ata-WDC_WD80EZAZ-11TDBA0_2SG991TJ /dev/disk/by-id/ata-WDC_WD80EZAZ-11TDBA0_2SGA23EJ /dev/disk/by-id/ata-ST8000DM004-2CX188_ZCT1AK0F
|
||||||
|
zfs_datasets:
|
||||||
|
- dataset: ssd_vm_mirror/vm
|
||||||
|
state: present
|
||||||
|
compression: lz4
|
||||||
|
sync: disabled
|
||||||
|
xattr: sa
|
||||||
|
dnodesize: auto
|
||||||
|
atime: on
|
||||||
|
snapdir: hidden
|
||||||
|
- dataset: hdd_vm_mirror/vm
|
||||||
|
state: present
|
||||||
|
compression: lz4
|
||||||
|
sync: disabled
|
||||||
|
xattr: sa
|
||||||
|
dnodesize: auto
|
||||||
|
atime: on
|
||||||
|
snapdir: hidden
|
||||||
|
### mgrote.apcupsd
|
||||||
|
apcupsd_nis_master: true
|
||||||
|
apcupsd_nis_master_hostname: pve-test.grote.lan
|
|
@ -1,29 +1,32 @@
|
||||||
---
|
---
|
||||||
### mgrote.zfs_manage_datasets
|
### mgrote.zfs_manage_datasets
|
||||||
# "Daten"-Datasets verwalte ich händisch!
|
# "Daten"-Datasets verwalte ich händisch!
|
||||||
# zfs create -o encryption=aes-256-gcm -o keyformat=passphrase hdd_data_raidz/data_crypt
|
# zfs create -o encryption=aes-256-gcm -o keyformat=passphrase hdd_data_raidz/data_crypt
|
||||||
# zfs create hdd_data_raidz/videos
|
# zfs create hdd_data_raidz/videos
|
||||||
# Pools müssen vorher erstellt sein!
|
# Pools müssen vorher erstellt sein!
|
||||||
# SSD_VM_MIRROR
|
# SSD_VM_MIRROR
|
||||||
# zpool create -f -o ashift=12 ssd_vm_mirror mirror /dev/disk/by-id/ata-ADATA_SU650_2J4420001210 /dev/disk/by-id/ata-ADATA_SU650_2J4420001241
|
# zpool create -f -o ashift=12 ssd_vm_mirror mirror /dev/disk/by-id/ata-ADATA_SU650_2J4420001210 /dev/disk/by-id/ata-ADATA_SU650_2J4420001241
|
||||||
# HDD_VM_MIRROR
|
# HDD_VM_MIRROR
|
||||||
# zpool create -f -o ashift=12 hdd_vm_mirror mirror /dev/disk/by-id/ata-WDC_WD20EACS-11BHUB0_WD-WCAZA3124223 /dev/disk/by-id/ata-WDC_WD20EZRX-00D8PB0_WD-WMC4M1682516 mirror /dev/disk/by-id/ata-WDC_WD30EZRX-00DC0B0_WD-WMC1T3979908 /dev/disk/by-id/ata-TOSHIBA_DT01ACA300_83M2DRAKS
|
# zpool create -f -o ashift=12 hdd_vm_mirror mirror /dev/disk/by-id/ata-WDC_WD20EACS-11BHUB0_WD-WCAZA3124223 /dev/disk/by-id/ata-WDC_WD20EZRX-00D8PB0_WD-WMC4M1682516 mirror /dev/disk/by-id/ata-WDC_WD30EZRX-00DC0B0_WD-WMC1T3979908 /dev/disk/by-id/ata-TOSHIBA_DT01ACA300_83M2DRAKS
|
||||||
# HDD_DATA_RAIDZ
|
# HDD_DATA_RAIDZ
|
||||||
# zpool create -f -o ashift=12 hdd_data_raidz raidz /dev/disk/by-id/ata-WDC_WD80EZAZ-11TDBA0_2SG991TJ /dev/disk/by-id/ata-WDC_WD80EZAZ-11TDBA0_2SGA23EJ /dev/disk/by-id/ata-ST8000DM004-2CX188_ZCT1AK0F
|
# zpool create -f -o ashift=12 hdd_data_raidz raidz /dev/disk/by-id/ata-WDC_WD80EZAZ-11TDBA0_2SG991TJ /dev/disk/by-id/ata-WDC_WD80EZAZ-11TDBA0_2SGA23EJ /dev/disk/by-id/ata-ST8000DM004-2CX188_ZCT1AK0F
|
||||||
zfs_datasets:
|
zfs_datasets:
|
||||||
- dataset: ssd_vm_mirror/vm
|
- dataset: ssd_vm_mirror/vm
|
||||||
state: present
|
state: present
|
||||||
compression: lz4
|
compression: lz4
|
||||||
sync: disabled
|
sync: disabled
|
||||||
xattr: sa
|
xattr: sa
|
||||||
dnodesize: auto
|
dnodesize: auto
|
||||||
atime: on
|
atime: on
|
||||||
snapdir: hidden
|
snapdir: hidden
|
||||||
- dataset: hdd_vm_mirror/vm
|
- dataset: hdd_vm_mirror/vm
|
||||||
state: present
|
state: present
|
||||||
compression: lz4
|
compression: lz4
|
||||||
sync: disabled
|
sync: disabled
|
||||||
xattr: sa
|
xattr: sa
|
||||||
dnodesize: auto
|
dnodesize: auto
|
||||||
atime: on
|
atime: on
|
||||||
snapdir: hidden
|
snapdir: hidden
|
||||||
|
### mgrote.apcupsd
|
||||||
|
apcupsd_nis_master: true
|
||||||
|
apcupsd_nis_master_hostname: pve2.grote.lan
|
||||||
|
|
|
@ -1,25 +1,68 @@
|
||||||
## mgrote.apcupsd
|
## mgrote.apcupsd
|
||||||
|
|
||||||
### Beschreibung
|
### Beschreibung
|
||||||
Installiert APCUPSD fuer eine APC UPS mit USB Verbindung.
|
* Installiert apcupsd.
|
||||||
Benoetigt mgrote.postfix.
|
* Auf einem PC als "Master", hier ist die USV per USB angeschlossen.
|
||||||
https://linux.die.net/man/5/apcupsd.conf
|
* Auf allen anderen PCs als "Slave", diese OCs pollen alle n Sekunden den Master.
|
||||||
|
* Benoetigt mgrote.postfix.
|
||||||
|
* Getestet mit: APC-BX950U-GR
|
||||||
|
|
||||||
|
### Links
|
||||||
|
* http://www.apcupsd.org/manual/#checking-your-configuration-file
|
||||||
|
* https://linux.die.net/man/5/apcupsd.conf
|
||||||
|
|
||||||
|
|
||||||
### Funktioniert auf
|
### Funktioniert auf
|
||||||
- [x] ProxMox 6.1
|
- [x] ProxMox 6.1
|
||||||
|
|
||||||
### Variablen + Defaults
|
### Variablen + Defaults
|
||||||
##### Wohin gehen die Benachrichtigungsmails bei Stromausfall
|
##### Zeitspanne in Sekunden, ab der der Systemdienst einen Stromausfall annimmt. Nuetzlich, um sehr kurze Ausfaelle ignorieren zu koennen. Jeweils Master und Slave.
|
||||||
empfaenger_mail: michael.grote@posteo.de
|
```yaml
|
||||||
|
apcupsd_master_onbatterydelay: 10
|
||||||
|
apcupsd_slave_onbatterydelay: 10
|
||||||
|
```
|
||||||
|
##### Durch die USV gemeldete Restkapazitaet in Prozent, ab der der Rechner heruntergefahren wird. Jeweils Master und Slave.
|
||||||
|
```yaml
|
||||||
|
apcupsd_master_batterylevel_for_shutdown: 50
|
||||||
|
apcupsd_slave_batterylevel_for_shutdown: 60
|
||||||
|
```
|
||||||
|
##### apcupsd will shutdown the system during a power failure when the remaining runtime on batteries as internally calculated by the UPS falls below the specified minutes. Jeweils Master und Slave.
|
||||||
|
```yaml
|
||||||
|
apcupsd_master_minutes_for_shutdown: 10
|
||||||
|
apcupsd_slave_minutes_for_shutdown: 11
|
||||||
|
```
|
||||||
|
##### Specifies when apcupsd should create the NOLOGON file to prevent users from logging on to the system. Jeweils Master und Slave.
|
||||||
|
```yaml
|
||||||
|
apcupsd_master_nologon_when_active: always
|
||||||
|
apcupsd_slave_nologon_when_active: always
|
||||||
|
```
|
||||||
|
|
||||||
##### Zeitspanne in Sekunden, ab der der Systemdienst einen Stromausfall annimmt. Nuetzlich, um sehr kurze Ausfaelle ignorieren zu koennen.
|
##### Ist der Server MASTER, also ist die USV an diesem Computer angeschlossen, kann nur für einen PC "true" sein. Jeweils Master und Slave.
|
||||||
ONBATTERYDELAY: 10
|
```yaml
|
||||||
|
apcupsd_nis_master: "true"
|
||||||
|
```
|
||||||
|
|
||||||
##### Durch die USV gemeldete Restkapazitaet in Prozent, ab der der Rechner heruntergefahren wird
|
##### Wenn "true" ist dieser Host master, für alle anderen "false", das muss nicht explizit gesetzt werden.
|
||||||
BATTERYLEVEL: 50
|
```yaml
|
||||||
|
apcupsd_nis_master: on
|
||||||
|
```
|
||||||
|
|
||||||
##### apcupsd will shutdown the system during a power failure when the remaining runtime on batteries as internally calculated by the UPS falls below the specified minutes.
|
##### FQDN oder IP des "master"
|
||||||
MINUTES: 10
|
```yaml
|
||||||
|
apcupsd_nis_master_hostname: pve2.grote.lan
|
||||||
|
```
|
||||||
|
|
||||||
##### Specifies when apcupsd should create the nologon file to prevent users from logging on to the system.
|
##### Interface auf dem der "Master" erreichbar ist.
|
||||||
NOLOGON: always
|
```yaml
|
||||||
|
apcupsd_nis_master_listen_ip: 0.0.0.0
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Post auf dem der "Master" erreichbar ist.
|
||||||
|
```yaml
|
||||||
|
apcupsd_nis_master_listen_port: 3551
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Name der USV
|
||||||
|
```yaml
|
||||||
|
apcupsd_ups_name: APC-BX950U-GR
|
||||||
|
```
|
||||||
|
|
|
@ -1,5 +1,16 @@
|
||||||
---
|
---
|
||||||
ONBATTERYDELAY: 10
|
apcupsd_master_onbatterydelay: 10
|
||||||
BATTERYLEVEL: 50
|
apcupsd_master_batterylevel_for_shutdown: 50
|
||||||
MINUTES: 10
|
apcupsd_master_minutes_for_shutdown: 10
|
||||||
NOLOGON: always
|
apcupsd_master_nologon_when_active: always
|
||||||
|
|
||||||
|
apcupsd_slave_onbatterydelay: 10
|
||||||
|
apcupsd_slave_batterylevel_for_shutdown: 60
|
||||||
|
apcupsd_slave_minutes_for_shutdown: 11
|
||||||
|
apcupsd_slave_nologon_when_active: always
|
||||||
|
|
||||||
|
apcupsd_nis_master: on
|
||||||
|
apcupsd_nis_master_hostname: pve2.grote.lan
|
||||||
|
apcupsd_nis_master_listen_ip: 0.0.0.0
|
||||||
|
apcupsd_nis_master_listen_port: 3551
|
||||||
|
apcupsd_ups_name: APC-BX950U-GR
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
- name: apcupsd installieren
|
---
|
||||||
|
- name: install apcupsd packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- apcupsd
|
- apcupsd
|
||||||
|
@ -8,13 +9,25 @@
|
||||||
become: yes
|
become: yes
|
||||||
notify: apc_access_mail
|
notify: apc_access_mail
|
||||||
|
|
||||||
- name: apcupsd kopieren
|
- name: create master config
|
||||||
|
include_tasks: master.yml
|
||||||
|
when:
|
||||||
|
- apcupsd_nis_master
|
||||||
|
- apcupsd_nis_master is defined
|
||||||
|
|
||||||
|
- name: create slave config
|
||||||
|
include_tasks: slave.yml
|
||||||
|
when:
|
||||||
|
- not apcupsd_nis_master
|
||||||
|
- apcupsd_nis_master is defined
|
||||||
|
|
||||||
|
- name: copy apcupsd file
|
||||||
become: yes
|
become: yes
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "apcupsd"
|
src: "apcupsd"
|
||||||
dest: "/etc/default/apcupsd"
|
dest: "/etc/default/apcupsd"
|
||||||
|
|
||||||
- name: empfaenger_mail_setzen
|
- name: set mail recipient
|
||||||
become: yes
|
become: yes
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/apcupsd/apccontrol #wo
|
path: /etc/apcupsd/apccontrol #wo
|
||||||
|
@ -22,9 +35,8 @@
|
||||||
line: export SYSADMIN={{ empfaenger_mail }} #ersetze durch...
|
line: export SYSADMIN={{ empfaenger_mail }} #ersetze durch...
|
||||||
backrefs: yes #verhindert das die zeile bei "nicht zutreffen" am ende der datei angefuegt wird: https://docs.ansible.com/ansible/latest/modules/lineinfile_module.html#parameters
|
backrefs: yes #verhindert das die zeile bei "nicht zutreffen" am ende der datei angefuegt wird: https://docs.ansible.com/ansible/latest/modules/lineinfile_module.html#parameters
|
||||||
|
|
||||||
- name: apcupsd.conf_kopieren
|
- name: copy test script
|
||||||
become: yes
|
become: yes
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "apcupsd.conf"
|
src: "apccontrol.save"
|
||||||
dest: "/etc/apcupsd/apcupsd.conf"
|
dest: "/etc/apcupsd/apccontrol.save"
|
||||||
notify: restart_apcupsd #benachrichtigt handlers/main.yml-restart-apcupsd_restart um den dient neuzustarten, nur wenn hier status "changed" ausgeworfen wird"
|
|
||||||
|
|
7
roles/mgrote.apcupsd/tasks/master.yml
Normal file
7
roles/mgrote.apcupsd/tasks/master.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
- name: templating master_apcupsd.conf
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "master_apcupsd.conf"
|
||||||
|
dest: "/etc/apcupsd/apcupsd.conf"
|
||||||
|
notify: restart_apcupsd #benachrichtigt handlers/main.yml-restart-apcupsd_restart um den dient neuzustarten, nur wenn hier status "changed" ausgeworfen wird"
|
7
roles/mgrote.apcupsd/tasks/slave.yml
Normal file
7
roles/mgrote.apcupsd/tasks/slave.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
- name: templating slave_apcupsd.conf
|
||||||
|
become: yes
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "slave_apcupsd.conf"
|
||||||
|
dest: "/etc/apcupsd/apcupsd.conf"
|
||||||
|
notify: restart_apcupsd #benachrichtigt handlers/main.yml-restart-apcupsd_restart um den dient neuzustarten, nur wenn hier status "changed" ausgeworfen wird"
|
137
roles/mgrote.apcupsd/templates/apccontrol.save
Normal file
137
roles/mgrote.apcupsd/templates/apccontrol.save
Normal file
|
@ -0,0 +1,137 @@
|
||||||
|
#!@SCRIPTSHELL@
|
||||||
|
#
|
||||||
|
# Safe apccontrol for testing.
|
||||||
|
#
|
||||||
|
# This apccontrol can be used for testing without fear
|
||||||
|
# that it will bring your system down
|
||||||
|
# @configure_input@
|
||||||
|
#
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
APCUPSD=@sbindir@/apcupsd
|
||||||
|
SHUTDOWN=@SHUTDOWN@
|
||||||
|
SCRIPTDIR=@sysconfdir@
|
||||||
|
|
||||||
|
#
|
||||||
|
case "$1" in
|
||||||
|
killpower)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: ${APCUPSD} --killpower would have been.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
commfailure)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: Communications with UPS lost.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
commok)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: Communciations with UPS restored.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
powerout)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: Warning power loss detected.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
onbattery)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: Power failure. Running on UPS batteries.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
offbattery)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: Off battery. Mains returned.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
failing)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: UPS battery power exhausted. Doing shutdown.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
timeout)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: UPS battery runtime limit exceeded. Doing shutdown.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
loadlimit)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: UPS battery discharge limit reached. Doing shutdown.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
runlimit)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: UPS battery runtime percent reached. Doing shutdown.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
doreboot)
|
||||||
|
wall <EOF
|
||||||
|
apccontrol: ${SHUTDOWN} for reboot would have been called.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
doshutdown)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: ${SHUTDOWN} for halt would have been called.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
mainsback)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: Power has returned...
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
annoyme)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: Power problems please logoff.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
emergency)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: ${SHUTDOWN} for emergency halt would have been called.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
changeme)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: Emergency! UPS batteries have failed.
|
||||||
|
|
||||||
|
Change them NOW !
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
remotedown)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: ${SHUTDOWN} for remote halt would have been called.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
startselftest)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: start self test would have been called.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
endselftest)
|
||||||
|
wall <<EOF
|
||||||
|
apccontrol: end self test would have been called.
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
*) echo "Usage: ${0##*/} command"
|
||||||
|
echo " warning: this script is intended to be launched by"
|
||||||
|
echo " apcupsd and should never be launched by users."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
|
@ -1,14 +0,0 @@
|
||||||
## apcupsd.conf v1.1 ##
|
|
||||||
UPSCABLE usb
|
|
||||||
|
|
||||||
UPSTYPE usb
|
|
||||||
DEVICE
|
|
||||||
|
|
||||||
UPSNAME APC-BX950U-GR
|
|
||||||
|
|
||||||
|
|
||||||
ONBATTERYDELAY {{ ONBATTERYDELAY }}
|
|
||||||
BATTERYLEVEL {{ BATTERYLEVEL }}
|
|
||||||
MINUTES {{ MINUTES }}
|
|
||||||
|
|
||||||
NOLOGON {{ NOLOGON }}
|
|
16
roles/mgrote.apcupsd/templates/master_apcupsd.conf
Normal file
16
roles/mgrote.apcupsd/templates/master_apcupsd.conf
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
## apcupsd.conf v1.1 ##
|
||||||
|
UPSCABLE usb
|
||||||
|
|
||||||
|
UPSTYPE usb
|
||||||
|
DEVICE
|
||||||
|
|
||||||
|
UPSNAME {{ apcupsd_ups_name }}
|
||||||
|
|
||||||
|
NETSERVER ON
|
||||||
|
NISIP {{ apcupsd_nis_master_listen_ip }}
|
||||||
|
NISPORT {{ apcupsd_nis_master_listen_port }}
|
||||||
|
|
||||||
|
ONBATTERYDELAY {{ apcupsd_master_onbatterydelay }}
|
||||||
|
BATTERYLEVEL {{ apcupsd_master_batterylevel_for_shutdown }}
|
||||||
|
MINUTES {{ apcupsd_master_minutes_for_shutdown }}
|
||||||
|
NOLOGON {{ apcupsd_master_nologon_when_active }}
|
15
roles/mgrote.apcupsd/templates/slave_apcupsd.conf
Normal file
15
roles/mgrote.apcupsd/templates/slave_apcupsd.conf
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
## apcupsd.conf v1.1 ##
|
||||||
|
|
||||||
|
UPSCABLE ether
|
||||||
|
UPSTYPE net
|
||||||
|
DEVICE {{ apcupsd_nis_master_hostname }}:{{ apcupsd_nis_master_listen_port }}
|
||||||
|
|
||||||
|
LOCKFILE /var/lock
|
||||||
|
UPSCLASS standalone
|
||||||
|
UPSMODE disable
|
||||||
|
POLLTIME 10
|
||||||
|
|
||||||
|
ONBATTERYDELAY {{ apcupsd_slave_onbatterydelay }}
|
||||||
|
BATTERYLEVEL {{ apcupsd_slave_batterylevel_for_shutdown }}
|
||||||
|
MINUTES {{ apcupsd_slave_minutes_for_shutdown }}
|
||||||
|
NOLOGON {{ apcupsd_slave_nologon_when_active }}
|
Loading…
Reference in a new issue