Add nut SSH remote shutdown
This commit is contained in:
@@ -6,3 +6,6 @@ ups_port_dev: 188 0
|
||||
|
||||
ups_master_pw: Noongaig1quor9Waepe9
|
||||
ups_slave_pw:
|
||||
|
||||
ups_hosts:
|
||||
- ariane
|
||||
|
||||
@@ -53,3 +53,6 @@
|
||||
template: dest=/etc/nut/upssched.conf src=upssched.conf.j2 owner=root group=nut mode=0640
|
||||
notify:
|
||||
restart nut
|
||||
|
||||
- name: nut - generate SSH-key
|
||||
user: name=nut createhome=yes generate_ssh_key=yes ssh_key_bits=4096 ssh_key_comment="nut ups shutdown"
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
#! /bin/sh
|
||||
case $1 in
|
||||
onbatt)
|
||||
ssh
|
||||
{% for host in ups_hosts %}
|
||||
ssh root@{{ host }}
|
||||
{% endfor %}
|
||||
;;
|
||||
lowbatt)
|
||||
/sbin/upssched fsd;;
|
||||
|
||||
Reference in New Issue
Block a user