Fix keepalived scripts

master
Vitaliy Filippov 2020-03-18 17:24:55 +03:00
parent dd945044b7
commit 631a25de83
2 changed files with 23 additions and 13 deletions

View File

@ -1,15 +1,10 @@
! Configuration File for keepalived
global_defs {
notification_email {
filippov@custis.ru
}
notification_email_from filippov@custis.ru
smtp_server localhost
smtp_connect_timeout 30
router_id $keepalived_router_id
script_user root
enable_script_security
lvs_sync_daemon $eth10g VI_1
}
vrrp_instance VI_1 {
@ -18,7 +13,6 @@ vrrp_instance VI_1 {
garp_master_delay 10
smtp_alert
virtual_router_id 51
lvs_sync_daemon_interface $eth10g
priority 100
advert_int 1
authentication {

View File

@ -1,17 +1,33 @@
#!/bin/bash
set -e
TYPE=$1
NAME=$2
STATE=$3
case $STATE in
"MASTER") systemctl opennebula start; systemctl opennebula-sunstone start; systemctl opennebula-scheduler start; systemctl opennebula-novnc start
;;
"BACKUP") systemctl opennebula stop; systemctl opennebula-sunstone stop; systemctl opennebula-scheduler stop; systemctl opennebula-novnc stop
;;
"FAULT") systemctl opennebula stop; systemctl opennebula-sunstone stop; systemctl opennebula-scheduler stop; systemctl opennebula-novnc stop
"MASTER")
systemctl start opennebula
systemctl start opennebula-sunstone
systemctl start opennebula-scheduler
systemctl start opennebula-novnc
exit 0
;;
*) /sbin/logger "ipsec unknown state"
"BACKUP")
systemctl stop opennebula
systemctl stop opennebula-sunstone
systemctl stop opennebula-scheduler
systemctl stop opennebula-novnc
exit 0
;;
"FAULT")
systemctl stop opennebula
systemctl stop opennebula-sunstone
systemctl stop opennebula-scheduler
systemctl stop opennebula-novnc
exit 0
;;
*) /sbin/logger "opennebula: unknown state"
exit 1
;;
esac