Ansible-HAProxy-Failover/roles/haproxy/templates/keepalived.conf.j2

31 lines
804 B
Django/Jinja

vrrp_track_process track_haproxy {
process haproxy
weight {{ haproxy_keepalived_process_weight }}
}
vrrp_instance VI_1 {
{% if haproxy_keepalived_adapter_vlan != '' %}
interface {{ haproxy_keepalived_adapter }}.{{ haproxy_keepalived_adapter_vlan }}
{% else %}
interface {{ haproxy_keepalived_adapter }}
{% endif %}
state {{ haproxy_shared_state }}
virtual_router_id {{ haproxy_shared_virtual_router_id }}
priority {{ haproxy_shared_priority }}
{% if haproxy_shared_password != '' %}
authentication {
auth_type PASS
auth_pass {{ haproxy_shared_password }}
}
{% endif %}
virtual_ipaddress {
{{ haproxy_shared_ip }}{{ haproxy_shared_ip_subnet }} dev {{ haproxy_bind_adapter }}
}
track_process {
track_haproxy
}
}