Configured haproxies
This commit is contained in:
20
roles/keepalived/templates/keepalived_haproxy.j2
Normal file
20
roles/keepalived/templates/keepalived_haproxy.j2
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
TYPE=${1}
|
||||
NAME=${2}
|
||||
STATE=${3}
|
||||
|
||||
case ${STATE} in
|
||||
"MASTER") service haproxy start
|
||||
exit 0
|
||||
;;
|
||||
"BACKUP") service haproxy start
|
||||
exit 0
|
||||
;;
|
||||
"FAULT") service haproxy stop
|
||||
exit 0
|
||||
;;
|
||||
*) echo "unknown state"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user