Use last part of virtual IP as router ID
This commit is contained in:
parent
6af59d3d73
commit
20e50b4128
|
@ -32,7 +32,7 @@ vrrp_script chk_{{ keepalived_chk_proc_name }} {
|
||||||
vrrp_instance {{ keepalived_instance_name|default('VI_1') }} {
|
vrrp_instance {{ keepalived_instance_name|default('VI_1') }} {
|
||||||
state {{ keepalived_state|default('BACKUP') }}
|
state {{ keepalived_state|default('BACKUP') }}
|
||||||
interface {{ keepalived_interface|default('eth0') }}
|
interface {{ keepalived_interface|default('eth0') }}
|
||||||
virtual_router_id {{ keepalived_router_id|default(100) }}
|
virtual_router_id {{ keepalived_router_id|default((keepalived_virtual_ipaddress|ipaddr('address')).0.split('.')[3]) }}
|
||||||
priority {{ ((keepalived_state|default('BACKUP'))=='MASTER')|ternary('100', '95') }}
|
priority {{ ((keepalived_state|default('BACKUP'))=='MASTER')|ternary('100', '95') }}
|
||||||
advert_int {{ keepalived_advert_int|default(1) }}
|
advert_int {{ keepalived_advert_int|default(1) }}
|
||||||
authentication {
|
authentication {
|
||||||
|
|
Loading…
Reference in a new issue