ansible/roles/keepalived/templates/keepalived.conf
Jeltz 8883e672bd
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Harmonisation of variable names
2022-01-02 20:31:49 +01:00

58 lines
1.2 KiB
Text

{{ ansible_managed | comment }}
global_defs {
dynamic_interfaces
script_user root
enable_script_security
vrrp_version 3
}
vrrp_sync_group group {
group {
instance_v4
instance_v6
}
{% if keepalived_notify_master %}
notify_master "{{ keepalived_notify_master }}"
{% endif %}
{% if keepalived_notify_backup is defined %}
notify_backup "{{ keepalived_notify_backup }}"
{% endif %}
{% if keepalived_notify_fault is defined %}
notify_fault "{{ keepalived_notify_fault }}"
{% endif %}
}
vrrp_instance instance_v4 {
virtual_router_id {{ keepalived_virtual_router_id }}
interface {{ keepalived_interface }}
state BACKUP
priority 250
nopreempt
advert_int 1
accept
virtual_ipaddress {
{% for dev, addrs in keepalived_virtual_ipv4_addrs.items() %}
{% for addr in addrs %}
{{ addr }} dev {{ dev }}
{% endfor %}
{% endfor %}
}
}
vrrp_instance instance_v6 {
virtual_router_id {{ keepalived_virtual_router_id }}
interface {{ keepalived_interface }}
state BACKUP
priority 250
nopreempt
advert_int 1
accept
virtual_ipaddress {
{% for dev, addrs in keepalived_virtual_ipv6_addrs.items() %}
{% for addr in addrs %}
{{ addr }} dev {{ dev }}
{% endfor %}
{% endfor %}
}
}