From cf83aa45922e6bac33b318969eabc4b4e395df3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavi=20Lle=C3=B3=20Tom=C3=A1s?= Date: Fri, 11 Apr 2025 13:42:01 +0200 Subject: [PATCH] maxscale: refs #8822 - refactor some minnor things --- roles/maxscale/templates/keepalived.conf.j2 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/roles/maxscale/templates/keepalived.conf.j2 b/roles/maxscale/templates/keepalived.conf.j2 index ed9a5e9..38dd78e 100644 --- a/roles/maxscale/templates/keepalived.conf.j2 +++ b/roles/maxscale/templates/keepalived.conf.j2 @@ -16,23 +16,22 @@ vrrp_script check_maxscale { vrrp_instance {{ vip.name }} { interface {{ k.interface }} state BACKUP - priority {{ k.priorities.master if vip.host == inventory_hostname_short else k.priorities.backup }} + priority {{ k.priorities.master if vip.host == inventory_hostname else k.priorities.backup }} virtual_router_id {{ vip.vrid }} advert_int 1 accept - unicast_src_ip {{ ansible_host }} + unicast_src_ip {{ ansible_default_ipv4.address }} unicast_peer { -{% for peer in k.peers if peer.host != inventory_hostname %} +{% for peer in k.peers %} +{% if peer.host != inventory_hostname %} {{ peer.ip }} +{% endif %} {% endfor %} } - - virtual_ipaddress { {{ vip.vip }} } - track_script { check_maxscale }