Merge "Jinja automation for %network%NetworkVlanId"

This commit is contained in:
Zuul 2019-04-08 21:10:15 +00:00 committed by Gerrit Code Review
commit b27b96c851
17 changed files with 115 additions and 18 deletions

View File

@ -174,6 +174,28 @@ parameters:
description: The IP address of the EC2 metadata server. (The parameter
is automatically resolved from the ctlplane subnet's host_routes attribute.)
type: string
# NOTE(hjensas): We need these because the default network_data.yaml define
# vlan for all networks.
ExternalNetworkVlanID:
default: 10
description: Vlan ID for the external network traffic.
type: number
InternalApiNetworkVlanID:
default: 20
description: Vlan ID for the internal_api network traffic.
type: number
StorageNetworkVlanID:
default: 30
description: Vlan ID for the storage network traffic.
type: number
StorageMgmtNetworkVlanID:
default: 40
description: Vlan ID for the storage_mgmt network traffic.
type: number
TenantNetworkVlanID:
default: 50
description: Vlan ID for the tenant network traffic.
type: number
resources:

View File

@ -162,6 +162,28 @@ parameters:
description: The IP address of the EC2 metadata server. (The parameter
is automatically resolved from the ctlplane subnet's host_routes attribute.)
type: string
# NOTE(hjensas): We need these because the default network_data.yaml define
# vlan for all networks.
ExternalNetworkVlanID:
default: 10
description: Vlan ID for the external network traffic.
type: number
InternalApiNetworkVlanID:
default: 20
description: Vlan ID for the internal_api network traffic.
type: number
StorageNetworkVlanID:
default: 30
description: Vlan ID for the storage network traffic.
type: number
StorageMgmtNetworkVlanID:
default: 40
description: Vlan ID for the storage_mgmt network traffic.
type: number
TenantNetworkVlanID:
default: 50
description: Vlan ID for the tenant network traffic.
type: number
resources:
OsNetConfigImpl:

View File

@ -159,6 +159,28 @@ parameters:
description: The IP address of the EC2 metadata server. (The parameter
is automatically resolved from the ctlplane subnet's host_routes attribute.)
type: string
# NOTE(hjensas): We need these because the default network_data.yaml define
# vlan for all networks.
ExternalNetworkVlanID:
default: 10
description: Vlan ID for the external network traffic.
type: number
InternalApiNetworkVlanID:
default: 20
description: Vlan ID for the internal_api network traffic.
type: number
StorageNetworkVlanID:
default: 30
description: Vlan ID for the storage network traffic.
type: number
StorageMgmtNetworkVlanID:
default: 40
description: Vlan ID for the storage_mgmt network traffic.
type: number
TenantNetworkVlanID:
default: 50
description: Vlan ID for the tenant network traffic.
type: number
resources:
OsNetConfigImpl:

View File

@ -50,7 +50,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -41,7 +41,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -39,7 +39,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -48,7 +48,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -39,7 +39,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan|default("")}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -38,7 +38,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan|default("")}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -49,7 +49,7 @@ parameters:
type: string
{%- if network.vlan %}
{{network.name}}NetworkVlanID:
default: {{network.vlan|default("")}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{%- endif %}

View File

@ -38,7 +38,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -48,7 +48,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -41,7 +41,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -38,7 +38,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -48,7 +48,7 @@ parameters:
description: IP address/subnet on the {{network.name_lower}} network
type: string
{{network.name}}NetworkVlanID:
default: {{network.vlan}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{{network.name}}Mtu:

View File

@ -67,7 +67,7 @@ parameters:
type: string
{%- if network.vlan %}
{{network.name}}NetworkVlanID:
default: {{network.vlan|default('')}}
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{%- endif %}
@ -114,10 +114,10 @@ parameters:
default route for the {{network.name_lower}} network's {{subnet}} subnet.
type: string
{{network.name}}NetworkVlanID_{{subnet}}:
default: {{network.subnets[subnet]['vlan']|default('')}}
default: {{network.subnets[subnet]['vlan']|default(1)}}
description: |
Vlan ID for the {{network.name_lower}} network's {{subnet}} subnet.
type: string
type: number
{{network.name}}Routes_{{subnet}}:
default: {{network.subnets[subnet]['routes']|default([])}}
description: >

View File

@ -269,8 +269,7 @@ parameters:
If not set the nameservers configured in the ctlplane subnet's
dns_nameservers attribute will be used.
type: comma_delimited_list
{%- for network in networks %}
{%- if network.enabled|default(true) and network.name in role.networks|default([]) %}
{%- for network in networks if network.enabled|default(true) and network.name in role.networks|default([]) %}
{{network.name}}InterfaceRoutes:
default: []
description: >
@ -279,7 +278,28 @@ parameters:
Unless the default is changed, the parameter is automatically resolved
from the subnet host_routes attribute.
type: json
{%- endif %}
{%- if role.networks is mapping %}
{%- set _subnets = network.get('subnets') %}
{%- set _role_net_subnet = role.networks[network.name].get('subnet') %}
{%- if _subnets and _role_net_subnet and _role_net_subnet in _subnets %}
{{network.name}}NetworkVlanID_{{_role_net_subnet}}:
default: {{_role_net_subnet.vlan|default(1)}}
description: >
Vlan ID for the {{network.name_lower}} network traffic for subnet
{{_role_net_subnet}}.
type: number
{%- elif network.vlan|default(false) %}
{{network.name}}NetworkVlanID:
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{%- endif %}
{%- elif network.vlan|default(false) %}
{{network.name}}NetworkVlanID:
default: {{network.vlan|default(1)}}
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{%- endif %}
{%- endfor %}
ServerDeletionPolicy:
@ -545,6 +565,17 @@ resources:
{%- if network.name in role.default_route_networks %}
{{network.name}}InterfaceDefaultRoute: {get_attr: [{{network.name}}Port, gateway_ip]}
{%- endif %}
{%- if role.networks is mapping %}
{%- set _subnets = network.get('subnets') %}
{%- set _role_net_subnet = role.networks[network.name].get('subnet') %}
{%- if _subnets and _role_net_subnet and _role_net_subnet in _subnets %}
{{network.name}}NetworkVlanID: {get_param: {{network.name}}NetworkVlanID_{{_role_net_subnet}}}
{%- elif network.vlan|default(false) %}
{{network.name}}NetworkVlanID: {get_param: {{network.name}}NetworkVlanID}
{%- endif %}
{%- elif network.vlan|default(false) %}
{{network.name}}NetworkVlanID: {get_param: {{network.name}}NetworkVlanID}
{%- endif %}
{%- endif %}
{%- endfor %}