Add ctlplane network attrs to Networks resource output

Add the attributes of ctlplane network and subnets to
the output of the Networks resource.

Also, set 'ctlplane_mtu' in group_vars. Follow-up changes
will add other ctlplane subnet attributes to group_vars.

The ctlplane attributes are added to the plan environment
by the depends-on tripleoclient change.

Depends-On: https://review.opendev.org/753195
Change-Id: Ic1772b384ad5b2003563b4e3d41a4a2f0e82f8e6
This commit is contained in:
Harald Jensås 2020-09-22 12:50:04 +02:00
parent 5b3878580a
commit 7e9a07212b
2 changed files with 9 additions and 1 deletions

View File

@ -6,6 +6,13 @@ parameters:
CtlplaneNetworkCidrs:
type: json
description: Cidrs for the ctlplane network.
CtlplaneNetworkAttributes:
type: json
default: {}
description: >
A map containing attributes of the undercloud ctlplane network and
subnets. NOTE: The value for this parameter is automatically populated in
the plan environment by tripleoclient.
resources:
{%- for network in networks if network.enabled|default(true) %}
@ -20,7 +27,6 @@ resources:
NetworkExtraConfig:
type: OS::TripleO::Network::ExtraConfig
outputs:
net_cidr_map:
value:
@ -43,6 +49,7 @@ outputs:
{%- endfor %}
net_attributes_map:
value:
ctlplane: {get_param: CtlplaneNetworkAttributes}
{%- for network in networks if network.enabled|default(true) %}
{%- set network_name = network.compat_name|default(network.name) %}
{{network.name_lower}}:

View File

@ -919,6 +919,7 @@ resources:
type: OS::Heat::Value
properties:
value:
ctlplane_mtu: {get_attr: [Networks, net_attributes_map, ctlplane, network, mtu]}
{%- for network in networks if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name_lower}}_mtu: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, network, mtu]}
{%- if role.networks is mapping %}