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 }}