Remove unused params in jinja rendered network config templates

Since change I07822ec0cba7eed352c0010eb893b5e5a522e95c removed the
noop resources only parameters for networks used by the role is
passed to the network config templates.

Add a conditional when iterating over networks in jinja templates
so that only parameters for networks used by the role is included.

Change-Id: I8b6c7d247d719a7c8559c4be5e35c478a0f189f7
Related-Bug: #1800811
This commit is contained in:
Harald Jensås 2018-12-14 09:58:34 +01:00
parent c4b816e8c5
commit 2f84e6e951
4 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ parameters:
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
{% for network in networks %}
{% for network in networks if network.enabled|default(true) and network.name in role.networks %}
{{network.name}}IpSubnet:
default: ''
description: IP address/subnet on the {{network.name_lower}} network

View File

@ -25,7 +25,7 @@ parameters:
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
{% for network in networks %}
{% for network in networks if network.enabled|default(true) and network.name in role.networks %}
{{network.name}}IpSubnet:
default: ''
description: IP address/subnet on the {{network.name_lower}} network

View File

@ -25,7 +25,7 @@ parameters:
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
{% for network in networks %}
{% for network in networks if network.enabled|default(true) and network.name in role.networks %}
{{network.name}}IpSubnet:
default: ''
description: IP address/subnet on the {{network.name_lower}} network

View File

@ -25,7 +25,7 @@ parameters:
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
{% for network in networks %}
{% for network in networks if network.enabled|default(true) and network.name in role.networks %}
{{network.name}}IpSubnet:
default: ''
description: IP address/subnet on the {{network.name_lower}} network