Use the correct var to calculate address prefix
The _addr loop was inserted but not referenced when calculating the address host/prefix pair. Change-Id: I970cc6c12a744fb8a28c2b0ef28e4d08b0c8e90a
This commit is contained in:
parent
dfc5f5578b
commit
80c397cfb6
@ -21,7 +21,7 @@ Metric={{ 20 + loop.index }}
|
||||
{%- if item.1.address is not defined %}
|
||||
{# Address is not defined #}
|
||||
{% set _addresses = [] %}
|
||||
{% elif item.1.address is iterable and not string %}
|
||||
{% elif item.1.address is iterable and item.1.address is not string %}
|
||||
{# Address is a list, multiple addresses defined #}
|
||||
{% set _addresses = item.1.address %}
|
||||
{% else %}
|
||||
@ -37,7 +37,7 @@ Metric={{ 20 + loop.index }}
|
||||
{% if _addr.address == 'dhcp' %}
|
||||
DHCP=yes
|
||||
{% else %}
|
||||
{% set _addr_cidr = (item.1.address | string + '/' + item.1.netmask | default('') | string).rstrip('/') | ipaddr('host/prefix') %}
|
||||
{% set _addr_cidr = (_addr.address ~ '/' ~ _addr.netmask | default('')).rstrip('/') | ipaddr('host') %}
|
||||
Address={{ _addr_cidr }}
|
||||
{% endif %}
|
||||
{% if _addr.gateway is defined %}
|
||||
|
Loading…
Reference in New Issue
Block a user