Some refinements to the keepalivedi configuration.

This commit is contained in:
Andrea Dell'Amico 2020-10-01 19:11:50 +02:00
parent 5dcdf0731b
commit abc39e59bc
1 changed files with 15 additions and 2 deletions

View File

@ -33,7 +33,20 @@ keepalived_instances:
- '{{ keepalived_floating_ip1 }}'
track_script:
- '{{ keepalived_script1_name }}'
track_interface:
- '{{ ansible_default_ipv4.interface }}'
authentication: PASS
authpass: '{{ keepass_auth_pwd }}'
keepalived_notify_extra_params: |
case $STATE in
"MASTER") logger "This HAPROXY instance is now in MASTER state"
;;
"BACKUP") logger "This HAPROXY instance is now in BACKUP state"
ip addr del {{ keepalived_floating_ip1 }} dev {{ ansible_default_ipv4.interface }}
;;
"FAULT") logger "This HAPROXY instance went into FAULT state"
RETVAL=0
;;
*) logger "HAPROXY server is in an unknown state"
RETVAL=1
;;
esac