From 2f2ed116f76f656dbb0a871b9b7e4dc1708718c4 Mon Sep 17 00:00:00 2001 From: Arthur Outhenin-Chalandre Date: Thu, 27 Aug 2020 08:15:03 +0200 Subject: [PATCH] Improve metallb template for bgp peers (#6574) Signed-off-by: Arthur Outhenin-Chalandre --- roles/kubernetes-apps/metallb/defaults/main.yml | 1 + roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/kubernetes-apps/metallb/defaults/main.yml b/roles/kubernetes-apps/metallb/defaults/main.yml index 479f06363..716cb2b6a 100644 --- a/roles/kubernetes-apps/metallb/defaults/main.yml +++ b/roles/kubernetes-apps/metallb/defaults/main.yml @@ -5,3 +5,4 @@ metallb_protocol: "layer2" metallb_port: "7472" metallb_limits_cpu: "100m" metallb_limits_mem: "100Mi" +metallb_peers: [] diff --git a/roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 b/roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 index 1a4d20a73..263561bbe 100644 --- a/roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 +++ b/roles/kubernetes-apps/metallb/templates/metallb-config.yml.j2 @@ -6,7 +6,7 @@ metadata: name: config data: config: | -{% if metallb_protocol == 'bgp' %} +{% if metallb_peers | length > 0 %} peers: {% for peer in metallb_peers %} - peer-address: {{ peer.peer_address }}