mirror of https://github.com/Aidaho12/haproxy-wi
59 lines
1.2 KiB
Django/Jinja
59 lines
1.2 KiB
Django/Jinja
global_defs {
|
|
# Managed by Roxy-WI do not edit this file. Use HA cluster configuration instead
|
|
router_id LVS_DEVEL
|
|
}
|
|
|
|
|
|
{%- if NGINX %}
|
|
#NGINX health-check for keepalive
|
|
vrrp_script chk_nginx {
|
|
script "systemctl is-active --quiet nginx"
|
|
interval 2
|
|
weight 3
|
|
}
|
|
{% endif %}
|
|
|
|
{%- if HAPROXY %}
|
|
#HAProxy health-check for keepalive
|
|
vrrp_script chk_haproxy {
|
|
script "systemctl is-active --quiet haproxy"
|
|
interval 2
|
|
weight 3
|
|
}
|
|
{% endif %}
|
|
|
|
|
|
{% for router, vip in routers.items() %}
|
|
{% for vrrp, s in vip.items() %}
|
|
vrrp_instance VI_{{router}} {
|
|
state {{s.master}}
|
|
interface {{s.eth}}
|
|
|
|
virtual_router_id {{router}}
|
|
priority {% if s.return_master and s.master %}152{% elif s.master and not s.return_master %}102{% else %}101{%endif%}
|
|
|
|
#check if we are still running
|
|
track_script {
|
|
|
|
|
|
{%- if HAPROXY %}
|
|
chk_haproxy
|
|
{% endif %}
|
|
{%- if NGINX %}
|
|
chk_nginx
|
|
{% endif %}
|
|
}
|
|
|
|
advert_int 1
|
|
authentication {
|
|
auth_type PASS
|
|
auth_pass VerySecretPass
|
|
}
|
|
virtual_ipaddress {
|
|
{{vrrp}}
|
|
}
|
|
}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
# Managed by Roxy-WI do not edit this file. Use HA cluster configuration instead
|