Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "keepalived_virtual_router_id" variable #513

Merged
merged 3 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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