2017-11-11 19:14:21 +08:00
|
|
|
global_defs {
|
2018-09-05 09:24:32 +08:00
|
|
|
router_id lb-backup-{{ inventory_hostname }}
|
2017-11-11 19:14:21 +08:00
|
|
|
}
|
|
|
|
|
2018-08-15 09:36:01 +08:00
|
|
|
vrrp_script check-haproxy {
|
|
|
|
script "killall -0 haproxy"
|
|
|
|
interval 5
|
|
|
|
weight -60
|
|
|
|
}
|
|
|
|
|
2017-11-11 19:14:21 +08:00
|
|
|
vrrp_instance VI-kube-master {
|
|
|
|
state BACKUP
|
2018-08-15 09:36:01 +08:00
|
|
|
priority {{ 119 | random(61, 1) }}
|
2018-07-13 11:24:34 +08:00
|
|
|
unicast_src_ip {{ inventory_hostname }}
|
|
|
|
unicast_peer {
|
2018-08-14 19:11:04 +08:00
|
|
|
{% for h in groups['lb'] %}{% if h != inventory_hostname %}
|
|
|
|
{{ h }}
|
|
|
|
{% endif %}{% endfor %}
|
2018-07-13 11:24:34 +08:00
|
|
|
}
|
2017-11-11 19:14:21 +08:00
|
|
|
dont_track_primary
|
|
|
|
interface {{ LB_IF }}
|
2018-03-09 22:29:39 +08:00
|
|
|
virtual_router_id {{ ROUTER_ID }}
|
2017-11-11 19:14:21 +08:00
|
|
|
advert_int 3
|
2018-08-15 09:36:01 +08:00
|
|
|
track_script {
|
|
|
|
check-haproxy
|
|
|
|
}
|
2017-11-11 19:14:21 +08:00
|
|
|
virtual_ipaddress {
|
2018-04-10 18:06:12 +08:00
|
|
|
{{ MASTER_IP }}
|
2017-11-11 19:14:21 +08:00
|
|
|
}
|
|
|
|
}
|