From 56a51647c34bd38788415c9923a25893c60b7b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Tue, 9 Apr 2019 23:00:37 +0200 Subject: [PATCH] Add {{network.name}}NetworkVlanID to THT/net-config-* With the default network_data.yaml and default roles_data.yaml all composable networks are included. When deploying plain defaults without any network-isolation, i.e ctlplane network only the jinja2 rendered templates still include all the nets. With change: https://review.openstack.org/645159 the vlan parameter is passed to NIC configs for all networks enabled for the role in roles data if networks data define a vlan id. Because of this we need to add the parameter to the nic config template unless networks data and roles data are customized. (i.e networks that are'nt actually used are removed from the roles data and networks data.) Closes-Bug: #1823997 Change-Id: Ic5fe9c8097de814ce3ad7032f42b31859051f70a --- net-config-bond.j2.yaml | 4 ++++ net-config-bridge.j2.yaml | 4 ++++ net-config-linux-bridge.j2.yaml | 4 ++++ net-config-noop.j2.yaml | 4 ++++ net-config-static-bridge-with-external-dhcp.j2.yaml | 4 ++++ net-config-static-bridge.j2.yaml | 4 ++++ net-config-static.j2.yaml | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/net-config-bond.j2.yaml b/net-config-bond.j2.yaml index 1eda73c84a..383884635b 100644 --- a/net-config-bond.j2.yaml +++ b/net-config-bond.j2.yaml @@ -68,6 +68,10 @@ parameters: default: '' description: default route for the {{network.name_lower}} network type: string + {{network.name}}NetworkVlanID: + default: {{network.vlan|default(1)}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number {%- endfor %} resources: OsNetConfigImpl: diff --git a/net-config-bridge.j2.yaml b/net-config-bridge.j2.yaml index d53508d9ea..43818ebf69 100644 --- a/net-config-bridge.j2.yaml +++ b/net-config-bridge.j2.yaml @@ -66,6 +66,10 @@ parameters: default: '' description: default route for the {{network.name_lower}} network type: string + {{network.name}}NetworkVlanID: + default: {{network.vlan|default(1)}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number {%- endfor %} resources: OsNetConfigImpl: diff --git a/net-config-linux-bridge.j2.yaml b/net-config-linux-bridge.j2.yaml index 7b6e109aee..50517ad4b2 100644 --- a/net-config-linux-bridge.j2.yaml +++ b/net-config-linux-bridge.j2.yaml @@ -29,6 +29,10 @@ parameters: default: '' description: default route for the {{network.name_lower}} network type: string + {{network.name}}NetworkVlanID: + default: {{network.vlan|default(1)}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number {%- endfor %} ControlPlaneDefaultRoute: description: The default route of the control plane network. (The parameter diff --git a/net-config-noop.j2.yaml b/net-config-noop.j2.yaml index dc09bdbe9a..f7db339d33 100644 --- a/net-config-noop.j2.yaml +++ b/net-config-noop.j2.yaml @@ -69,6 +69,10 @@ parameters: default: '' description: default route for the {{network.name_lower}} network type: string + {{network.name}}NetworkVlanID: + default: {{network.vlan|default(1)}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number {%- endfor %} resources: diff --git a/net-config-static-bridge-with-external-dhcp.j2.yaml b/net-config-static-bridge-with-external-dhcp.j2.yaml index f15856c143..2bdc8607a9 100644 --- a/net-config-static-bridge-with-external-dhcp.j2.yaml +++ b/net-config-static-bridge-with-external-dhcp.j2.yaml @@ -30,6 +30,10 @@ parameters: default: '' description: default route for the {{network.name_lower}} network type: string + {{network.name}}NetworkVlanID: + default: {{network.vlan|default(1)}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number {%- endfor %} ControlPlaneSubnetCidr: default: '' diff --git a/net-config-static-bridge.j2.yaml b/net-config-static-bridge.j2.yaml index f2813227a6..a55cf7ad3b 100644 --- a/net-config-static-bridge.j2.yaml +++ b/net-config-static-bridge.j2.yaml @@ -30,6 +30,10 @@ parameters: default: '' description: default route for the {{network.name_lower}} network type: string + {{network.name}}NetworkVlanID: + default: {{network.vlan|default(1)}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number {%- endfor %} ControlPlaneSubnetCidr: default: '' diff --git a/net-config-static.j2.yaml b/net-config-static.j2.yaml index f6563c9534..7b18aaa97b 100644 --- a/net-config-static.j2.yaml +++ b/net-config-static.j2.yaml @@ -29,6 +29,10 @@ parameters: default: '' description: default route for the {{network.name_lower}} network type: string + {{network.name}}NetworkVlanID: + default: {{network.vlan|default(1)}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number {%- endfor %} ControlPlaneSubnetCidr: default: ''