From 0fb1f7ddf37a5b270262f12799febf466930144e Mon Sep 17 00:00:00 2001 From: gjmzj Date: Tue, 14 Aug 2018 19:11:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A4=9Alb=E8=8A=82=E7=82=B9=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF?= =?UTF-8?q?=20Issue=20#286?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- roles/lb/templates/keepalived-backup.conf.j2 | 5 +++-- roles/lb/templates/keepalived-master.conf.j2 | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/roles/lb/templates/keepalived-backup.conf.j2 b/roles/lb/templates/keepalived-backup.conf.j2 index 38cdaa2..8af5c3c 100644 --- a/roles/lb/templates/keepalived-backup.conf.j2 +++ b/roles/lb/templates/keepalived-backup.conf.j2 @@ -7,8 +7,9 @@ vrrp_instance VI-kube-master { priority 110 unicast_src_ip {{ inventory_hostname }} unicast_peer { - {% for h in groups['lb'] %}{% if h != inventory_hostname %}{{ h }}{% endif %}{% endfor %} - +{% for h in groups['lb'] %}{% if h != inventory_hostname %} + {{ h }} +{% endif %}{% endfor %} } dont_track_primary interface {{ LB_IF }} diff --git a/roles/lb/templates/keepalived-master.conf.j2 b/roles/lb/templates/keepalived-master.conf.j2 index 367bb3c..ea01955 100644 --- a/roles/lb/templates/keepalived-master.conf.j2 +++ b/roles/lb/templates/keepalived-master.conf.j2 @@ -13,8 +13,9 @@ vrrp_instance VI-kube-master { priority 120 unicast_src_ip {{ inventory_hostname }} unicast_peer { - {% for h in groups['lb'] %}{% if h != inventory_hostname %}{{ h }}{% endif %}{% endfor %} - +{% for h in groups['lb'] %}{% if h != inventory_hostname %} + {{ h }} +{% endif %}{% endfor %} } dont_track_primary interface {{ LB_IF }}