51 lines
1.0 KiB
Plaintext
51 lines
1.0 KiB
Plaintext
|
global_defs {
|
||
|
enable_script_security
|
||
|
script_user keepaliveddd
|
||
|
}
|
||
|
|
||
|
vrrp_script track_haproxy {
|
||
|
script "/etc/keepalived/chck_haproxy.sh"
|
||
|
interval 2
|
||
|
}
|
||
|
|
||
|
vrrp_instance NGDB--LB {
|
||
|
state MASTER
|
||
|
{% if keepalived_int is not "eth0"%}
|
||
|
interface {{ keepalived_int }}
|
||
|
{% else %}
|
||
|
interface eth0
|
||
|
{% endif %}
|
||
|
{% if keepalived_vrid is not 30%}
|
||
|
virtual_router_id {{ keepalived_vrid }}
|
||
|
{% else %}
|
||
|
virtual_router_id 30
|
||
|
{% endif %}
|
||
|
priority 100
|
||
|
advert_int 1
|
||
|
|
||
|
unicast_src_ip {{ hostvars[inventory_hostname]['ansible_host'] }}
|
||
|
unicast_peer {
|
||
|
{% for host in groups["galera_lb_nodes"] %}
|
||
|
{{ host }}
|
||
|
{% endfor%}
|
||
|
}
|
||
|
|
||
|
authentication {
|
||
|
auth_type PASS
|
||
|
{% if authpass is not "ChangeMe"%}
|
||
|
auth_pass {{ authpass }}
|
||
|
{% else %}
|
||
|
auth_pass 4zaLp1MV
|
||
|
{% endif %}
|
||
|
}
|
||
|
|
||
|
track_script {
|
||
|
track_haproxy
|
||
|
}
|
||
|
|
||
|
virtual_ipaddress {
|
||
|
{{ vip_address }}/{{ vip_address_cidr }} dev {{ vip_address_int }}
|
||
|
}
|
||
|
|
||
|
}
|