From d8345c5eae473d80aea34aebf7692609dc8c06c6 Mon Sep 17 00:00:00 2001 From: Samuel Liu Date: Mon, 27 Apr 2020 14:55:28 +0800 Subject: [PATCH] MetalLB IP address range extension (#6023) * MetalLB IP address range extension * MetalLB IP address range extension --- contrib/metallb/roles/provision/defaults/main.yml | 6 ++++-- .../roles/provision/templates/metallb-config.yml.j2 | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/contrib/metallb/roles/provision/defaults/main.yml b/contrib/metallb/roles/provision/defaults/main.yml index 4a7c7c471..ff68d3303 100644 --- a/contrib/metallb/roles/provision/defaults/main.yml +++ b/contrib/metallb/roles/provision/defaults/main.yml @@ -1,10 +1,12 @@ --- metallb: - ip_range: "10.5.0.50-10.5.0.99" + ip_range: + - "10.5.0.50-10.5.0.99" protocol: "layer2" # additional_address_pools: # kube_service_pool: - # ip_range: "10.5.1.50-10.5.1.99" + # ip_range: + # - 10.5.1.50-10.5.1.99" # protocol: "layer2" # auto_assign: false limits: diff --git a/contrib/metallb/roles/provision/templates/metallb-config.yml.j2 b/contrib/metallb/roles/provision/templates/metallb-config.yml.j2 index 6f2f87339..f35aada13 100644 --- a/contrib/metallb/roles/provision/templates/metallb-config.yml.j2 +++ b/contrib/metallb/roles/provision/templates/metallb-config.yml.j2 @@ -10,12 +10,16 @@ data: - name: loadbalanced protocol: {{ metallb.protocol }} addresses: - - {{ metallb.ip_range }} +{% for ip_range in metallb.ip_range %} + - {{ ip_range }} +{% endfor %} {% if metallb.additional_address_pools is defined %}{% for pool in metallb.additional_address_pools %} - name: {{ pool }} protocol: {{ metallb.additional_address_pools[pool].protocol }} addresses: - - {{ metallb.additional_address_pools[pool].ip_range }} +{% for ip_range in metallb.additional_address_pools[pool].ip_range %} + - {{ ip_range }} +{% endfor %} auto-assign: {{ metallb.additional_address_pools[pool].auto_assign }} {% endfor %} {% endif %}