Skip to content

Commit

Permalink
Add "keepalived_virtual_router_id" variable (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Nov 21, 2023
1 parent b9e41c8 commit 431a1ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion roles/keepalived/templates/keepalived.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vrrp_script haproxy_check {

vrrp_instance VI_1 {
interface {{ vip_interface }}
virtual_router_id {{ cluster_vip.split('.')[3] | int }}
virtual_router_id {{ keepalived_virtual_router_id | default(123) }}
priority 100
advert_int 2
state BACKUP
Expand Down
6 changes: 5 additions & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ haproxy_timeout:
client: "60m"
server: "60m"

# vip-manager (if cluster_vip is specified and with_haproxy_load_balancing: false)
# keepalived (if 'cluster_vip' is specified and 'with_haproxy_load_balancing' is 'true')
keepalived_virtual_router_id: "{{ cluster_vip.split('.')[3] | int }}" # The last octet of 'cluster_vip' IP address is used by default.
# virtual_router_id - must be unique in the network (available values are 0..255).

# vip-manager (if 'cluster_vip' is specified and 'with_haproxy_load_balancing' is 'false')
vip_manager_version: "2.1.0" # version to install
vip_manager_conf: "/etc/patroni/vip-manager.yml"
vip_manager_interval: "1000" # time (in milliseconds) after which vip-manager wakes up and checks if it needs to register or release ip addresses.
Expand Down

0 comments on commit 431a1ea

Please sign in to comment.