From a4622f13826b4479e61744a5f87990f22b439a2c Mon Sep 17 00:00:00 2001 From: Rabi Mishra Date: Mon, 14 Sep 2020 15:30:15 +0530 Subject: [PATCH] Use OS::Heat::Value for NetworkConfig This removes the run-os-net-config.sh script and uses OS::Heat::Value for the NetworkConfig resources. Depends-On: https://review.opendev.org/#/c/751713/ Change-Id: Ic3a0234d36525cdd6f415c77733d05a39bbeb3c2 --- ci/common/net-config-multinode.yaml | 34 +- ci/common/net-config-simple-bridge.yaml | 38 +-- .../nic-configs/ceph-storage.yaml | 68 ++-- .../nic-configs/cinder-storage.yaml | 16 +- .../nic-configs/compute-dvr.yaml | 116 ++++--- .../nic-configs/compute.yaml | 92 +++--- .../nic-configs/controller.yaml | 134 ++++---- .../nic-configs/swift-storage.yaml | 16 +- .../nic-configs/ceph-storage.yaml | 66 ++-- .../nic-configs/cinder-storage.yaml | 16 +- .../nic-configs/compute-dvr.yaml | 115 ++++--- .../multiple-nics/nic-configs/compute.yaml | 90 +++--- .../multiple-nics/nic-configs/controller.yaml | 124 ++++---- .../nic-configs/swift-storage.yaml | 16 +- .../public-bond/nic-configs/ceph-storage.yaml | 66 ++-- .../nic-configs/cinder-storage.yaml | 16 +- .../public-bond/nic-configs/compute.yaml | 90 +++--- .../public-bond/nic-configs/controller.yaml | 140 ++++----- .../nic-configs/swift-storage.yaml | 16 +- net-config-bond.j2.yaml | 52 ++-- net-config-bridge.j2.yaml | 40 +-- net-config-linux-bridge.j2.yaml | 54 ++-- net-config-standalone.j2.yaml | 105 +++---- ...g-static-bridge-with-external-dhcp.j2.yaml | 64 ++-- net-config-static-bridge.j2.yaml | 60 ++-- net-config-static.j2.yaml | 52 ++-- net-config-undercloud.j2.yaml | 104 +++---- .../2-linux-bonds-vlans/role.role.j2.yaml | 278 ++++++++--------- .../controller-no-external.j2.yaml | 176 +++++------ .../config/bond-with-vlans/role.role.j2.yaml | 234 +++++++------- .../multiple-nics-vlans/compute-dvr.j2.yaml | 218 +++++++------ .../multiple-nics-vlans/role.role.j2.yaml | 194 ++++++------ .../config/multiple-nics/compute-dvr.j2.yaml | 194 ++++++------ .../config/multiple-nics/role.role.j2.yaml | 172 +++++----- .../role.role.j2.yaml | 106 +++---- .../controller-no-external.j2.yaml | 80 +++-- .../config/single-nic-vlans/role.role.j2.yaml | 102 +++--- network/scripts/run-os-net-config.sh | 1 - puppet/role.role.j2.yaml | 2 +- tools/merge-new-params-nic-config-script.py | 4 - tools/yaml-nic-config-2-script.py | 294 ------------------ 41 files changed, 1663 insertions(+), 2192 deletions(-) delete mode 100755 network/scripts/run-os-net-config.sh delete mode 100755 tools/yaml-nic-config-2-script.py diff --git a/ci/common/net-config-multinode.yaml b/ci/common/net-config-multinode.yaml index a2f5e6c0e3..07b2f19644 100644 --- a/ci/common/net-config-multinode.yaml +++ b/ci/common/net-config-multinode.yaml @@ -182,27 +182,21 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: ovs_bridge - name: br-ex - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr + value: + network_config: + - type: ovs_bridge + name: br-ex + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/common/net-config-simple-bridge.yaml b/ci/common/net-config-simple-bridge.yaml index a1d16dc83b..89cbf36561 100644 --- a/ci/common/net-config-simple-bridge.yaml +++ b/ci/common/net-config-simple-bridge.yaml @@ -179,30 +179,24 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: ovs_bridge - name: br-ctlplane - use_dhcp: false - ovs_extra: - - "br-set-external-id br-ctlplane bridge-id br-ctlplane" - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr + value: + network_config: + - type: ovs_bridge + name: br-ctlplane + use_dhcp: false + ovs_extra: + - "br-set-external-id br-ctlplane bridge-id br-ctlplane" + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/ceph-storage.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/ceph-storage.yaml index 29ad375988..3a26262146 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/ceph-storage.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/ceph-storage.yaml @@ -89,44 +89,38 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - routes: - - default: true - ip_netmask: 0.0.0.0/0 - next_hop: {get_param: ControlPlaneDefaultRoute} - - type: interface - name: nic4 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: interface - name: nic5 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageMgmtIpSubnet} - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + routes: + - default: true + ip_netmask: 0.0.0.0/0 + next_hop: {get_param: ControlPlaneDefaultRoute} + - type: interface + name: nic4 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: interface + name: nic5 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageMgmtIpSubnet} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/cinder-storage.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/cinder-storage.yaml index 9202314b69..336cd73825 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/cinder-storage.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/cinder-storage.yaml @@ -111,18 +111,12 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: [] - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: [] outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/compute-dvr.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/compute-dvr.yaml index d6ea5517aa..869a89b669 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/compute-dvr.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/compute-dvr.yaml @@ -120,68 +120,62 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - routes: - - default: true - ip_netmask: 0.0.0.0/0 - next_hop: {get_param: ControlPlaneDefaultRoute} - - type: interface - name: nic3 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: InternalApiIpSubnet} - - type: interface - name: nic4 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: ovs_bridge - name: br-tenant - dns_servers: {get_param: DnsServers} - domain: {get_param: DnsSearchDomains} - use_dhcp: false - addresses: - - ip_netmask: {get_param: TenantIpSubnet} - members: - - type: interface - name: nic6 - mtu: 1350 - primary: true - - type: ovs_bridge - name: br-ex - dns_servers: {get_param: DnsServers} - use_dhcp: false - routes: - - ip_netmask: ::/0 - next_hop: {get_param: ExternalInterfaceDefaultRoute} - members: - - type: interface - name: nic2 - mtu: 1350 - primary: true - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + routes: + - default: true + ip_netmask: 0.0.0.0/0 + next_hop: {get_param: ControlPlaneDefaultRoute} + - type: interface + name: nic3 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: InternalApiIpSubnet} + - type: interface + name: nic4 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: ovs_bridge + name: br-tenant + dns_servers: {get_param: DnsServers} + domain: {get_param: DnsSearchDomains} + use_dhcp: false + addresses: + - ip_netmask: {get_param: TenantIpSubnet} + members: + - type: interface + name: nic6 + mtu: 1350 + primary: true + - type: ovs_bridge + name: br-ex + dns_servers: {get_param: DnsServers} + use_dhcp: false + routes: + - ip_netmask: ::/0 + next_hop: {get_param: ExternalInterfaceDefaultRoute} + members: + - type: interface + name: nic2 + mtu: 1350 + primary: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/compute.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/compute.yaml index eb77ea2029..e150757df3 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/compute.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/compute.yaml @@ -115,56 +115,50 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - routes: - - default: true - ip_netmask: 0.0.0.0/0 - next_hop: {get_param: ControlPlaneDefaultRoute} - - type: interface - name: nic3 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: InternalApiIpSubnet} - - type: interface - name: nic4 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: ovs_bridge - name: br-tenant - dns_servers: {get_param: DnsServers} - domain: {get_param: DnsSearchDomains} - use_dhcp: false - addresses: - - ip_netmask: {get_param: TenantIpSubnet} - members: - - type: interface - name: nic6 - mtu: 1350 - primary: true - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + routes: + - default: true + ip_netmask: 0.0.0.0/0 + next_hop: {get_param: ControlPlaneDefaultRoute} + - type: interface + name: nic3 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: InternalApiIpSubnet} + - type: interface + name: nic4 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: ovs_bridge + name: br-tenant + dns_servers: {get_param: DnsServers} + domain: {get_param: DnsSearchDomains} + use_dhcp: false + addresses: + - ip_netmask: {get_param: TenantIpSubnet} + members: + - type: interface + name: nic6 + mtu: 1350 + primary: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/controller.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/controller.yaml index b0383986e6..3fc733262c 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/controller.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/controller.yaml @@ -163,77 +163,71 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - routes: - - default: true - ip_netmask: 0.0.0.0/0 - next_hop: {get_param: ControlPlaneDefaultRoute} - - type: ovs_bridge - name: br-ex - dns_servers: {get_param: DnsServers} - domain: {get_param: DnsSearchDomains} - use_dhcp: false - addresses: - - ip_netmask: {get_param: ExternalIpSubnet} - routes: - - default: true - ip_netmask: ::/0 - next_hop: {get_param: ExternalInterfaceDefaultRoute} - members: - - type: interface - name: nic2 - mtu: 1350 - primary: true - - type: interface - name: nic3 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: InternalApiIpSubnet} - - type: interface - name: nic4 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: interface - name: nic5 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageMgmtIpSubnet} - - type: ovs_bridge - name: br-tenant - dns_servers: {get_param: DnsServers} - use_dhcp: false - addresses: - - ip_netmask: {get_param: TenantIpSubnet} - members: - - type: interface - name: nic6 - mtu: 1350 - primary: true - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + routes: + - default: true + ip_netmask: 0.0.0.0/0 + next_hop: {get_param: ControlPlaneDefaultRoute} + - type: ovs_bridge + name: br-ex + dns_servers: {get_param: DnsServers} + domain: {get_param: DnsSearchDomains} + use_dhcp: false + addresses: + - ip_netmask: {get_param: ExternalIpSubnet} + routes: + - default: true + ip_netmask: ::/0 + next_hop: {get_param: ExternalInterfaceDefaultRoute} + members: + - type: interface + name: nic2 + mtu: 1350 + primary: true + - type: interface + name: nic3 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: InternalApiIpSubnet} + - type: interface + name: nic4 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: interface + name: nic5 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageMgmtIpSubnet} + - type: ovs_bridge + name: br-tenant + dns_servers: {get_param: DnsServers} + use_dhcp: false + addresses: + - ip_netmask: {get_param: TenantIpSubnet} + members: + - type: interface + name: nic6 + mtu: 1350 + primary: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/swift-storage.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/swift-storage.yaml index 9202314b69..336cd73825 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/swift-storage.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/swift-storage.yaml @@ -111,18 +111,12 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: [] - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: [] outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics/nic-configs/ceph-storage.yaml b/ci/environments/network/multiple-nics/nic-configs/ceph-storage.yaml index 6acfc9be26..78c9722e89 100644 --- a/ci/environments/network/multiple-nics/nic-configs/ceph-storage.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/ceph-storage.yaml @@ -89,43 +89,37 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - routes: - - default: true - next_hop: {get_param: ControlPlaneDefaultRoute} - - type: interface - name: nic4 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: interface - name: nic5 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageMgmtIpSubnet} + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + routes: + - default: true + next_hop: {get_param: ControlPlaneDefaultRoute} + - type: interface + name: nic4 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: interface + name: nic5 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageMgmtIpSubnet} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics/nic-configs/cinder-storage.yaml b/ci/environments/network/multiple-nics/nic-configs/cinder-storage.yaml index e998b021a7..f1945d5e56 100644 --- a/ci/environments/network/multiple-nics/nic-configs/cinder-storage.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/cinder-storage.yaml @@ -89,18 +89,12 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: [] + value: + network_config: [] outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics/nic-configs/compute-dvr.yaml b/ci/environments/network/multiple-nics/nic-configs/compute-dvr.yaml index d2f880c1d6..02df7346e3 100644 --- a/ci/environments/network/multiple-nics/nic-configs/compute-dvr.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/compute-dvr.yaml @@ -117,70 +117,63 @@ parameters: description: default route for the external network type: string - resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - routes: - - default: true - next_hop: {get_param: ControlPlaneDefaultRoute} - - type: ovs_bridge - name: br-ex - dns_servers: {get_param: DnsServers} - domain: {get_param: DnsSearchDomains} - use_dhcp: false - routes: - - ip_netmask: 0.0.0.0/0 - next_hop: {get_param: ExternalInterfaceDefaultRoute} - members: - - type: interface - name: nic2 - mtu: 1350 - primary: true - - type: interface - name: nic3 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: InternalApiIpSubnet} - - type: interface - name: nic4 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: ovs_bridge - name: br-tenant - dns_servers: {get_param: DnsServers} - use_dhcp: false - addresses: - - ip_netmask: {get_param: TenantIpSubnet} - members: - - type: interface - name: nic6 - mtu: 1350 - primary: true + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + routes: + - default: true + next_hop: {get_param: ControlPlaneDefaultRoute} + - type: ovs_bridge + name: br-ex + dns_servers: {get_param: DnsServers} + domain: {get_param: DnsSearchDomains} + use_dhcp: false + routes: + - ip_netmask: 0.0.0.0/0 + next_hop: {get_param: ExternalInterfaceDefaultRoute} + members: + - type: interface + name: nic2 + mtu: 1350 + primary: true + - type: interface + name: nic3 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: InternalApiIpSubnet} + - type: interface + name: nic4 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: ovs_bridge + name: br-tenant + dns_servers: {get_param: DnsServers} + use_dhcp: false + addresses: + - ip_netmask: {get_param: TenantIpSubnet} + members: + - type: interface + name: nic6 + mtu: 1350 + primary: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics/nic-configs/compute.yaml b/ci/environments/network/multiple-nics/nic-configs/compute.yaml index c48ab33e19..92f60f9a2e 100644 --- a/ci/environments/network/multiple-nics/nic-configs/compute.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/compute.yaml @@ -115,55 +115,49 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - routes: - - default: true - next_hop: {get_param: ControlPlaneDefaultRoute} - - type: interface - name: nic3 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: InternalApiIpSubnet} - - type: interface - name: nic4 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: ovs_bridge - name: br-tenant - dns_servers: {get_param: DnsServers} - domain: {get_param: DnsSearchDomains} - use_dhcp: false - addresses: - - ip_netmask: {get_param: TenantIpSubnet} - members: - - type: interface - name: nic6 - mtu: 1350 - primary: true + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + routes: + - default: true + next_hop: {get_param: ControlPlaneDefaultRoute} + - type: interface + name: nic3 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: InternalApiIpSubnet} + - type: interface + name: nic4 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: ovs_bridge + name: br-tenant + dns_servers: {get_param: DnsServers} + domain: {get_param: DnsSearchDomains} + use_dhcp: false + addresses: + - ip_netmask: {get_param: TenantIpSubnet} + members: + - type: interface + name: nic6 + mtu: 1350 + primary: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics/nic-configs/controller.yaml b/ci/environments/network/multiple-nics/nic-configs/controller.yaml index 675b99ad21..c588d0a880 100644 --- a/ci/environments/network/multiple-nics/nic-configs/controller.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/controller.yaml @@ -163,72 +163,66 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - - type: ovs_bridge - name: br-ex - dns_servers: {get_param: DnsServers} - domain: {get_param: DnsSearchDomains} - use_dhcp: false - addresses: - - ip_netmask: {get_param: ExternalIpSubnet} - routes: - - ip_netmask: 0.0.0.0/0 - next_hop: {get_param: ExternalInterfaceDefaultRoute} - members: - - type: interface - name: nic2 - mtu: 1350 - primary: true - - type: interface - name: nic3 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: InternalApiIpSubnet} - - type: interface - name: nic4 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: interface - name: nic5 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageMgmtIpSubnet} - - type: ovs_bridge - name: br-tenant - dns_servers: {get_param: DnsServers} - use_dhcp: false - addresses: - - ip_netmask: {get_param: TenantIpSubnet} - members: - - type: interface - name: nic6 - mtu: 1350 - primary: true + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + - type: ovs_bridge + name: br-ex + dns_servers: {get_param: DnsServers} + domain: {get_param: DnsSearchDomains} + use_dhcp: false + addresses: + - ip_netmask: {get_param: ExternalIpSubnet} + routes: + - ip_netmask: 0.0.0.0/0 + next_hop: {get_param: ExternalInterfaceDefaultRoute} + members: + - type: interface + name: nic2 + mtu: 1350 + primary: true + - type: interface + name: nic3 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: InternalApiIpSubnet} + - type: interface + name: nic4 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: interface + name: nic5 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageMgmtIpSubnet} + - type: ovs_bridge + name: br-tenant + dns_servers: {get_param: DnsServers} + use_dhcp: false + addresses: + - ip_netmask: {get_param: TenantIpSubnet} + members: + - type: interface + name: nic6 + mtu: 1350 + primary: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/multiple-nics/nic-configs/swift-storage.yaml b/ci/environments/network/multiple-nics/nic-configs/swift-storage.yaml index 1eceee275f..336cd73825 100644 --- a/ci/environments/network/multiple-nics/nic-configs/swift-storage.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/swift-storage.yaml @@ -111,18 +111,12 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../../../../network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: [] + value: + network_config: [] outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/public-bond/nic-configs/ceph-storage.yaml b/ci/environments/network/public-bond/nic-configs/ceph-storage.yaml index 314cbbc7ab..603aeaca34 100644 --- a/ci/environments/network/public-bond/nic-configs/ceph-storage.yaml +++ b/ci/environments/network/public-bond/nic-configs/ceph-storage.yaml @@ -89,43 +89,37 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - routes: - - default: true - next_hop: {get_param: ControlPlaneDefaultRoute} - - type: interface - name: nic5 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: interface - name: nic6 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageMgmtIpSubnet} - template: - get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + routes: + - default: true + next_hop: {get_param: ControlPlaneDefaultRoute} + - type: interface + name: nic5 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: interface + name: nic6 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageMgmtIpSubnet} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/public-bond/nic-configs/cinder-storage.yaml b/ci/environments/network/public-bond/nic-configs/cinder-storage.yaml index 297f8b14dd..336cd73825 100644 --- a/ci/environments/network/public-bond/nic-configs/cinder-storage.yaml +++ b/ci/environments/network/public-bond/nic-configs/cinder-storage.yaml @@ -111,18 +111,12 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: [] - template: - get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: [] outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/public-bond/nic-configs/compute.yaml b/ci/environments/network/public-bond/nic-configs/compute.yaml index 8e9eec2195..5117645e7d 100644 --- a/ci/environments/network/public-bond/nic-configs/compute.yaml +++ b/ci/environments/network/public-bond/nic-configs/compute.yaml @@ -115,55 +115,49 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - routes: - - default: true - next_hop: {get_param: ControlPlaneDefaultRoute} - - type: interface - name: nic4 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: InternalApiIpSubnet} - - type: interface - name: nic5 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: ovs_bridge - name: br-tenant - dns_servers: {get_param: DnsServers} - domain: {get_param: DnsSearchDomains} - use_dhcp: false - addresses: - - ip_netmask: {get_param: TenantIpSubnet} - members: - - type: interface - name: nic7 - mtu: 1350 - primary: true - template: - get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + routes: + - default: true + next_hop: {get_param: ControlPlaneDefaultRoute} + - type: interface + name: nic4 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: InternalApiIpSubnet} + - type: interface + name: nic5 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: ovs_bridge + name: br-tenant + dns_servers: {get_param: DnsServers} + domain: {get_param: DnsSearchDomains} + use_dhcp: false + addresses: + - ip_netmask: {get_param: TenantIpSubnet} + members: + - type: interface + name: nic7 + mtu: 1350 + primary: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/public-bond/nic-configs/controller.yaml b/ci/environments/network/public-bond/nic-configs/controller.yaml index a85044d066..880ca1502e 100644 --- a/ci/environments/network/public-bond/nic-configs/controller.yaml +++ b/ci/environments/network/public-bond/nic-configs/controller.yaml @@ -157,80 +157,74 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - {get_param: ControlPlaneIp} - - {get_param: ControlPlaneSubnetCidr} - - type: ovs_bridge - name: br-ex - dns_servers: {get_param: DnsServers} - domain: {get_param: DnsSearchDomains} - use_dhcp: false - addresses: - - ip_netmask: {get_param: ExternalIpSubnet} - routes: - - ip_netmask: 0.0.0.0/0 - next_hop: {get_param: ExternalInterfaceDefaultRoute} - members: - - type: ovs_bond - name: bond1 - ovs_options: {get_param: BondInterfaceOvsOptions} - members: - - type: interface - name: nic2 - mtu: 1350 - primary: true - - type: interface - name: nic3 - mtu: 1350 - primary: false - - type: interface - name: nic4 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: InternalApiIpSubnet} - - type: interface - name: nic5 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageIpSubnet} - - type: interface - name: nic6 - mtu: 1350 - use_dhcp: false - addresses: - - ip_netmask: {get_param: StorageMgmtIpSubnet} - - type: ovs_bridge - name: br-tenant - dns_servers: {get_param: DnsServers} - use_dhcp: false - addresses: - - ip_netmask: {get_param: TenantIpSubnet} - members: - - type: interface - name: nic7 - mtu: 1350 - primary: true - template: - get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: + - type: interface + name: nic1 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - {get_param: ControlPlaneIp} + - {get_param: ControlPlaneSubnetCidr} + - type: ovs_bridge + name: br-ex + dns_servers: {get_param: DnsServers} + domain: {get_param: DnsSearchDomains} + use_dhcp: false + addresses: + - ip_netmask: {get_param: ExternalIpSubnet} + routes: + - ip_netmask: 0.0.0.0/0 + next_hop: {get_param: ExternalInterfaceDefaultRoute} + members: + - type: ovs_bond + name: bond1 + ovs_options: {get_param: BondInterfaceOvsOptions} + members: + - type: interface + name: nic2 + mtu: 1350 + primary: true + - type: interface + name: nic3 + mtu: 1350 + primary: false + - type: interface + name: nic4 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: InternalApiIpSubnet} + - type: interface + name: nic5 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageIpSubnet} + - type: interface + name: nic6 + mtu: 1350 + use_dhcp: false + addresses: + - ip_netmask: {get_param: StorageMgmtIpSubnet} + - type: ovs_bridge + name: br-tenant + dns_servers: {get_param: DnsServers} + use_dhcp: false + addresses: + - ip_netmask: {get_param: TenantIpSubnet} + members: + - type: interface + name: nic7 + mtu: 1350 + primary: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/ci/environments/network/public-bond/nic-configs/swift-storage.yaml b/ci/environments/network/public-bond/nic-configs/swift-storage.yaml index 297f8b14dd..336cd73825 100644 --- a/ci/environments/network/public-bond/nic-configs/swift-storage.yaml +++ b/ci/environments/network/public-bond/nic-configs/swift-storage.yaml @@ -111,18 +111,12 @@ parameters: resources: OsNetConfigImpl: + type: OS::Heat::Value properties: - config: - str_replace: - params: - $network_config: - network_config: [] - template: - get_file: /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh - group: script - type: OS::Heat::SoftwareConfig + value: + network_config: [] outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} + value: {get_attr: [OsNetConfigImpl, value]} diff --git a/net-config-bond.j2.yaml b/net-config-bond.j2.yaml index 9fdc368ed9..1789c25efd 100644 --- a/net-config-bond.j2.yaml +++ b/net-config-bond.j2.yaml @@ -74,36 +74,30 @@ parameters: {%- endfor %} resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: ovs_bridge - name: bridge_name - use_dhcp: true - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - members: - - type: ovs_bond - name: bond1 - use_dhcp: true - ovs_options: - get_param: BondInterfaceOvsOptions - members: - - type: interface - name: nic1 - - type: interface - name: nic2 + value: + network_config: + - type: ovs_bridge + name: bridge_name + use_dhcp: true + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + members: + - type: ovs_bond + name: bond1 + use_dhcp: true + ovs_options: + get_param: BondInterfaceOvsOptions + members: + - type: interface + name: nic1 + - type: interface + name: nic2 outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/net-config-bridge.j2.yaml b/net-config-bridge.j2.yaml index 53bf12cb3d..db898e7d57 100644 --- a/net-config-bridge.j2.yaml +++ b/net-config-bridge.j2.yaml @@ -72,31 +72,25 @@ parameters: {%- endfor %} resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: ovs_bridge - name: bridge_name - use_dhcp: true - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - members: - - type: interface - name: interface_name - # force the MAC address of the bridge to this interface - primary: true + value: + network_config: + - type: ovs_bridge + name: bridge_name + use_dhcp: true + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + members: + - type: interface + name: interface_name + # force the MAC address of the bridge to this interface + primary: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/net-config-linux-bridge.j2.yaml b/net-config-linux-bridge.j2.yaml index 6bda9be5da..2f1fc4c02e 100644 --- a/net-config-linux-bridge.j2.yaml +++ b/net-config-linux-bridge.j2.yaml @@ -74,39 +74,33 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: linux_bridge - name: bridge_name - addresses: - - ip_netmask: - get_param: ControlPlaneIp - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - members: - - type: interface - name: interface_name - # force the MAC address of the bridge to this interface - primary: true - routes: - - ip_netmask: 0.0.0.0/0 - next_hop: - get_param: ControlPlaneDefaultRoute - default: true + value: + network_config: + - type: linux_bridge + name: bridge_name + addresses: + - ip_netmask: + get_param: ControlPlaneIp + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + members: + - type: interface + name: interface_name + # force the MAC address of the bridge to this interface + primary: true + routes: + - ip_netmask: 0.0.0.0/0 + next_hop: + get_param: ControlPlaneDefaultRoute + default: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/net-config-standalone.j2.yaml b/net-config-standalone.j2.yaml index 22f3b1862b..cd8f3a7bdf 100644 --- a/net-config-standalone.j2.yaml +++ b/net-config-standalone.j2.yaml @@ -101,66 +101,57 @@ conditions: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - inputs: - - name: disable_configure_safe_defaults - default: true - config: - str_replace: - template: - get_file: network/scripts/run-os-net-config.sh - params: - $network_config: + value: + if: + - standalone_net_config_override + - {get_param: StandaloneNetConfigOverride} + - network_config: + - type: ovs_bridge + name: br-ctlplane + mtu: {get_param: InterfaceLocalMtu} + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + ovs_extra: + - "br-set-external-id br-ctlplane bridge-id br-ctlplane" + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + - if: - - standalone_net_config_override - - {get_param: StandaloneNetConfigOverride} - - network_config: - - type: ovs_bridge - name: br-ctlplane - mtu: {get_param: InterfaceLocalMtu} - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - ovs_extra: - - "br-set-external-id br-ctlplane bridge-id br-ctlplane" - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - - - if: - - control_virtual_ip_unset - - {} - - ip_netmask: - list_join: - - / - - - {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]} - - {if: [control_virtual_ip_is_ipv6, '128', '32']} - - - if: - - public_virtual_ip_unset - - {} - - ip_netmask: - list_join: - - / - - - {get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]} - - {if: [public_virtual_ip_is_ipv6, '128', '32']} - routes: {get_param: ControlPlaneStaticRoutes} - members: - - type: interface - name: {get_param: NeutronPublicInterface} - # force the MAC address of the bridge to this interface - primary: true - mtu: {get_param: InterfaceLocalMtu} + - control_virtual_ip_unset + - {} + - ip_netmask: + list_join: + - / + - - {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]} + - {if: [control_virtual_ip_is_ipv6, '128', '32']} + - + if: + - public_virtual_ip_unset + - {} + - ip_netmask: + list_join: + - / + - - {get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]} + - {if: [public_virtual_ip_is_ipv6, '128', '32']} + routes: {get_param: ControlPlaneStaticRoutes} + members: + - type: interface + name: {get_param: NeutronPublicInterface} + # force the MAC address of the bridge to this interface + primary: true + mtu: {get_param: InterfaceLocalMtu} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/net-config-static-bridge-with-external-dhcp.j2.yaml b/net-config-static-bridge-with-external-dhcp.j2.yaml index ceb937e51f..f066574ea3 100644 --- a/net-config-static-bridge-with-external-dhcp.j2.yaml +++ b/net-config-static-bridge-with-external-dhcp.j2.yaml @@ -74,42 +74,36 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: ovs_bridge - name: bridge_name - use_dhcp: true - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - members: - - type: interface - name: interface_name - # force the MAC address of the bridge to this interface - primary: true - - type: interface - name: br-ex:0 - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute + value: + network_config: + - type: ovs_bridge + name: bridge_name + use_dhcp: true + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + members: + - type: interface + name: interface_name + # force the MAC address of the bridge to this interface + primary: true + - type: interface + name: br-ex:0 + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + - default: true + next_hop: + get_param: ControlPlaneDefaultRoute outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/net-config-static-bridge.j2.yaml b/net-config-static-bridge.j2.yaml index 97cdacdc68..a119d0cadb 100644 --- a/net-config-static-bridge.j2.yaml +++ b/net-config-static-bridge.j2.yaml @@ -74,41 +74,35 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: ovs_bridge - name: bridge_name - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: interface_name - # force the MAC address of the bridge to this interface - primary: true + value: + network_config: + - type: ovs_bridge + name: bridge_name + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + - default: true + next_hop: + get_param: ControlPlaneDefaultRoute + members: + - type: interface + name: interface_name + # force the MAC address of the bridge to this interface + primary: true outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/net-config-static.j2.yaml b/net-config-static.j2.yaml index 21da33e61b..5c683ef5db 100644 --- a/net-config-static.j2.yaml +++ b/net-config-static.j2.yaml @@ -73,36 +73,30 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: network/scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: interface_name - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute + value: + network_config: + - type: interface + name: interface_name + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + - default: true + next_hop: + get_param: ControlPlaneDefaultRoute outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl + get_attr: + get_attr: [OsNetConfigImpl, value] diff --git a/net-config-undercloud.j2.yaml b/net-config-undercloud.j2.yaml index 9d72bbbe07..b353e49d86 100644 --- a/net-config-undercloud.j2.yaml +++ b/net-config-undercloud.j2.yaml @@ -97,65 +97,55 @@ conditions: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - inputs: - - name: disable_configure_safe_defaults - default: true - config: - str_replace: - template: - get_file: network/scripts/run-os-net-config.sh - params: - $network_config: + value: + if: + - undercloud_net_config_override + - {get_param: UndercloudNetConfigOverride} + - network_config: + - type: ovs_bridge + name: br-ctlplane + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + ovs_extra: + - "br-set-external-id br-ctlplane bridge-id br-ctlplane" + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + - if: - - undercloud_net_config_override - - {get_param: UndercloudNetConfigOverride} - - network_config: - - type: ovs_bridge - name: br-ctlplane - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - ovs_extra: - - "br-set-external-id br-ctlplane bridge-id br-ctlplane" - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - - - if: - - control_virtual_ip_unset - - {} - - ip_netmask: - list_join: - - / - - - {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]} - - {if: [control_virtual_ip_is_ipv6, '128', '32']} - - - if: - - public_virtual_ip_unset - - {} - - ip_netmask: - list_join: - - / - - - {get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]} - - {if: [public_virtual_ip_is_ipv6, '128', '32']} - routes: {get_param: ControlPlaneStaticRoutes} - members: - - type: interface - name: {get_param: NeutronPublicInterface} - # force the MAC address of the bridge to this interface - primary: true - mtu: {get_param: UndercloudLocalMtu} + - control_virtual_ip_unset + - {} + - ip_netmask: + list_join: + - / + - - {get_param: [DeployedServerPortMap, 'control_virtual_ip', fixed_ips, 0, ip_address]} + - {if: [control_virtual_ip_is_ipv6, '128', '32']} + - + if: + - public_virtual_ip_unset + - {} + - ip_netmask: + list_join: + - / + - - {get_param: [DeployedServerPortMap, 'public_virtual_ip', fixed_ips, 0, ip_address]} + - {if: [public_virtual_ip_is_ipv6, '128', '32']} + routes: {get_param: ControlPlaneStaticRoutes} + members: + - type: interface + name: {get_param: NeutronPublicInterface} + # force the MAC address of the bridge to this interface + primary: true + mtu: {get_param: UndercloudLocalMtu} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl - + get_attr: [OsNetConfigImpl, value] diff --git a/network/config/2-linux-bonds-vlans/role.role.j2.yaml b/network/config/2-linux-bonds-vlans/role.role.j2.yaml index 5456bd6321..e57d5b5a2f 100644 --- a/network/config/2-linux-bonds-vlans/role.role.j2.yaml +++ b/network/config/2-linux-bonds-vlans/role.role.j2.yaml @@ -137,157 +137,151 @@ resources: {%- endfor %} OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: - get_param: ControlPlaneMtu - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - list_concat_unique: - - get_param: ControlPlaneStaticRoutes + value: + network_config: + - type: interface + name: nic1 + mtu: + get_param: ControlPlaneMtu + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + list_concat_unique: + - get_param: ControlPlaneStaticRoutes {%- if role.default_route_networks is not defined or 'ControlPlane' in role.default_route_networks %} - - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute + - - default: true + next_hop: + get_param: ControlPlaneDefaultRoute {%- endif %} - - type: linux_bond - name: bond_api - mtu: - get_attr: [MinViableMtuBondApi, value] - use_dhcp: false - bonding_options: - get_param: BondInterfaceOvsOptions - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - members: - - type: interface - name: nic2 - mtu: - get_attr: [MinViableMtuBondApi, value] - primary: true - - type: interface - name: nic3 - mtu: - get_attr: [MinViableMtuBondApi, value] + - type: linux_bond + name: bond_api + mtu: + get_attr: [MinViableMtuBondApi, value] + use_dhcp: false + bonding_options: + get_param: BondInterfaceOvsOptions + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + members: + - type: interface + name: nic2 + mtu: + get_attr: [MinViableMtuBondApi, value] + primary: true + - type: interface + name: nic3 + mtu: + get_attr: [MinViableMtuBondApi, value] {%- for network in networks if network.enabled|default(true) and network.name in _role_networks and not network.name.startswith('Tenant') %} - - type: vlan - device: bond_api - mtu: - get_param: {{network.name}}Mtu - vlan_id: - get_param: {{network.name}}NetworkVlanID - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes - {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute - {%- endif %} + - type: vlan + device: bond_api + mtu: + get_param: {{network.name}}Mtu + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes +{%- if network.name in role.default_route_networks %} + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute +{%- endif %} {%- endfor %} {%- if not role.name.startswith('ComputeOvsDpdk') %} - - type: ovs_bridge - name: bridge_name - dns_servers: - get_param: DnsServers - members: - - type: linux_bond - name: bond-data - mtu: - get_attr: [MinViableMtuBondData, value] - bonding_options: - get_param: BondInterfaceOvsOptions - members: - - type: interface - name: nic4 - mtu: - get_attr: [MinViableMtuBondData, value] - primary: true - - type: interface - name: nic5 - mtu: - get_attr: [MinViableMtuBondData, value] - {%- for network in networks if network.name.startswith('Tenant') and network.name in _role_networks and network.enabled|default(true) %} - - type: vlan - device: bond-data - mtu: - get_param: {{network.name}}Mtu - vlan_id: - get_param: {{network.name}}NetworkVlanID - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes - {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute - {%- endif %} - {%- endfor %} + - type: ovs_bridge + name: bridge_name + dns_servers: + get_param: DnsServers + members: + - type: linux_bond + name: bond-data + mtu: + get_attr: [MinViableMtuBondData, value] + bonding_options: + get_param: BondInterfaceOvsOptions + members: + - type: interface + name: nic4 + mtu: + get_attr: [MinViableMtuBondData, value] + primary: true + - type: interface + name: nic5 + mtu: + get_attr: [MinViableMtuBondData, value] +{%- for network in networks if network.name.startswith('Tenant') and network.name in _role_networks and network.enabled|default(true) %} + - type: vlan + device: bond-data + mtu: + get_param: {{network.name}}Mtu + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes +{%- if network.name in role.default_route_networks %} + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute +{%- endif %} +{%- endfor %} {%- else %} - - type: ovs_user_bridge - name: br-dpdk0 - use_dhcp: false - {%- for network in networks if network.name.startswith('Tenant') and network.name in _role_networks and network.enabled|default(true) %} - ovs_extra: - - str_replace: - template: set port br-dpdk0 tag=_VLAN_TAG_ - params: - _VLAN_TAG_: {get_param: {{network.name}}NetworkVlanID} - addresses: - - ip_netmask: {get_param: {{network.name}}IpSubnet} - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes - {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute - {%- endif %} - {%- endfor %} - members: - - type: ovs_dpdk_bond - name: dpdkbond0 - rx_queue: - get_param: NumDpdkInterfaceRxQueues - members: - - type: ovs_dpdk_port - name: dpdk0 - members: - - type: interface - name: nic4 - - type: ovs_dpdk_port - name: dpdk1 - members: - - type: interface - name: nic5 + - type: ovs_user_bridge + name: br-dpdk0 + use_dhcp: false +{%- for network in networks if network.name.startswith('Tenant') and network.name in _role_networks and network.enabled|default(true) %} + ovs_extra: + - str_replace: + template: set port br-dpdk0 tag=_VLAN_TAG_ + params: + _VLAN_TAG_: {get_param: {{network.name}}NetworkVlanID} + addresses: + - ip_netmask: {get_param: {{network.name}}IpSubnet} + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes + {%- if network.name in role.default_route_networks %} + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute + {%- endif %} +{%- endfor %} + members: + - type: ovs_dpdk_bond + name: dpdkbond0 + rx_queue: + get_param: NumDpdkInterfaceRxQueues + members: + - type: ovs_dpdk_port + name: dpdk0 + members: + - type: interface + name: nic4 + - type: ovs_dpdk_port + name: dpdk1 + members: + - type: interface + name: nic5 {%- endif %} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/network/config/bond-with-vlans/controller-no-external.j2.yaml b/network/config/bond-with-vlans/controller-no-external.j2.yaml index 4161f30e85..8a0a7b3b72 100644 --- a/network/config/bond-with-vlans/controller-no-external.j2.yaml +++ b/network/config/bond-with-vlans/controller-no-external.j2.yaml @@ -82,99 +82,93 @@ parameters: type: string resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - list_concat_unique: - - get_param: ControlPlaneStaticRoutes - - - default: true # NOTE(hjensas): This is the IPv4 default route - next_hop: - get_param: ControlPlaneDefaultRoute - - type: ovs_bridge - name: bridge_name - use_dhcp: true - members: - - type: ovs_bond - name: bond1 - ovs_options: - get_param: BondInterfaceOvsOptions - members: - - type: interface - name: nic2 - primary: true - - type: interface - name: nic3 - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - routes: - get_param: InternalApiInterfaceRoutes - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - routes: - get_param: StorageInterfaceRoutes - - type: vlan - vlan_id: - get_param: StorageMgmtNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - routes: - get_param: StorageMgmtInterfaceRoutes - - type: vlan - vlan_id: - get_param: TenantNetworkVlanID - addresses: - - ip_netmask: - get_param: TenantIpSubnet - routes: - get_param: TenantInterfaceRoutes - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- type: vlan - # vlan_id: - # get_param: ManagementNetworkVlanID - # addresses: - # - ip_netmask: - # get_param: ManagementIpSubnet - # routes: - # list_concat_unique: - # - get_param: ManagementInterfaceRoutes - # - - default: true - # next_hop: - # get_param: ManagementInterfaceDefaultRoute + value: + network_config: + - type: interface + name: nic1 + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + list_concat_unique: + - get_param: ControlPlaneStaticRoutes + - - default: true # NOTE(hjensas): This is the IPv4 default route + next_hop: + get_param: ControlPlaneDefaultRoute + - type: ovs_bridge + name: bridge_name + use_dhcp: true + members: + - type: ovs_bond + name: bond1 + ovs_options: + get_param: BondInterfaceOvsOptions + members: + - type: interface + name: nic2 + primary: true + - type: interface + name: nic3 + - type: vlan + vlan_id: + get_param: InternalApiNetworkVlanID + addresses: + - ip_netmask: + get_param: InternalApiIpSubnet + routes: + get_param: InternalApiInterfaceRoutes + - type: vlan + vlan_id: + get_param: StorageNetworkVlanID + addresses: + - ip_netmask: + get_param: StorageIpSubnet + routes: + get_param: StorageInterfaceRoutes + - type: vlan + vlan_id: + get_param: StorageMgmtNetworkVlanID + addresses: + - ip_netmask: + get_param: StorageMgmtIpSubnet + routes: + get_param: StorageMgmtInterfaceRoutes + - type: vlan + vlan_id: + get_param: TenantNetworkVlanID + addresses: + - ip_netmask: + get_param: TenantIpSubnet + routes: + get_param: TenantInterfaceRoutes + # Uncomment when including environments/network-management.yaml + # If setting default route on the Management interface, comment + # out the default route on the Control Plane. + #- type: vlan + # vlan_id: + # get_param: ManagementNetworkVlanID + # addresses: + # - ip_netmask: + # get_param: ManagementIpSubnet + # routes: + # list_concat_unique: + # - get_param: ManagementInterfaceRoutes + # - - default: true + # next_hop: + # get_param: ManagementInterfaceDefaultRoute outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/network/config/bond-with-vlans/role.role.j2.yaml b/network/config/bond-with-vlans/role.role.j2.yaml index a3b7dbced9..ac3660c44b 100644 --- a/network/config/bond-with-vlans/role.role.j2.yaml +++ b/network/config/bond-with-vlans/role.role.j2.yaml @@ -115,144 +115,138 @@ resources: {%- endfor %} OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: - get_param: ControlPlaneMtu - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - list_concat_unique: - - get_param: ControlPlaneStaticRoutes + value: + network_config: + - type: interface + name: nic1 + mtu: + get_param: ControlPlaneMtu + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + list_concat_unique: + - get_param: ControlPlaneStaticRoutes {%- if role.default_route_networks is not defined or 'ControlPlane' in role.default_route_networks %} - - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute + - - default: true + next_hop: + get_param: ControlPlaneDefaultRoute {%- endif %} {%- if not role.name.startswith('ComputeOvsDpdk') %} - - type: ovs_bridge + - type: ovs_bridge {%- if role.name.startswith('CephStorage') or role.name.startswith('ObjectStorage') or role.name.startswith('BlockStorage') %} - name: br-bond + name: br-bond {%- else %} - name: bridge_name + name: bridge_name {%- endif %} - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - members: - - type: ovs_bond - name: bond1 - mtu: - get_attr: [MinViableMtu, value] - ovs_options: - get_param: BondInterfaceOvsOptions - members: - - type: interface - name: nic2 - mtu: - get_attr: [MinViableMtu, value] - primary: true - - type: interface - name: nic3 - mtu: - get_attr: [MinViableMtu, value] + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + members: + - type: ovs_bond + name: bond1 + mtu: + get_attr: [MinViableMtu, value] + ovs_options: + get_param: BondInterfaceOvsOptions + members: + - type: interface + name: nic2 + mtu: + get_attr: [MinViableMtu, value] + primary: true + - type: interface + name: nic3 + mtu: + get_attr: [MinViableMtu, value] {%- for network in networks if network.enabled|default(true) and network.name in _role_networks %} - - type: vlan - mtu: - get_param: {{network.name}}Mtu - vlan_id: - get_param: {{network.name}}NetworkVlanID - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes + - type: vlan + mtu: + get_param: {{network.name}}Mtu + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute {%- endif %} {%- endfor %} {%- else %} - # Linux bond for non-DPDK traffic required when using DPDK - - type: linux_bond - name: bond_api - mtu: - get_attr: [MinViableMtu, value] - bonding_options: - get_param: BondInterfaceOvsOptions - use_dhcp: false - dns_servers: - get_param: DnsServers - members: - - type: interface - name: nic2 - mtu: - get_attr: [MinViableMtu, value] - primary: true - - type: interface - name: nic3 - mtu: - get_attr: [MinViableMtu, value] + # Linux bond for non-DPDK traffic required when using DPDK + - type: linux_bond + name: bond_api + mtu: + get_attr: [MinViableMtu, value] + bonding_options: + get_param: BondInterfaceOvsOptions + use_dhcp: false + dns_servers: + get_param: DnsServers + members: + - type: interface + name: nic2 + mtu: + get_attr: [MinViableMtu, value] + primary: true + - type: interface + name: nic3 + mtu: + get_attr: [MinViableMtu, value] {%- for network in networks if network.enabled|default(true) and network.name in _role_networks %} - - type: vlan - device: bond_api - mtu: - get_param: {{network.name}}Mtu - vlan_id: - get_param: {{network.name}}NetworkVlanID - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes + - type: vlan + device: bond_api + mtu: + get_param: {{network.name}}Mtu + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute {%- endif %} {%- endfor %} - # Used as a provider network with external DHCP - - type: ovs_user_bridge - name: br-dpdk0 - members: - - type: ovs_dpdk_bond - name: dpdkbond0 - rx_queue: - get_param: NumDpdkInterfaceRxQueues - members: - - type: ovs_dpdk_port - name: dpdk0 - members: - - type: interface - name: nic4 - - type: ovs_dpdk_port - name: dpdk1 - members: - - type: interface - name: nic5 + # Used as a provider network with external DHCP + - type: ovs_user_bridge + name: br-dpdk0 + members: + - type: ovs_dpdk_bond + name: dpdkbond0 + rx_queue: + get_param: NumDpdkInterfaceRxQueues + members: + - type: ovs_dpdk_port + name: dpdk0 + members: + - type: interface + name: nic4 + - type: ovs_dpdk_port + name: dpdk1 + members: + - type: interface + name: nic5 {%- endif %} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/network/config/multiple-nics-vlans/compute-dvr.j2.yaml b/network/config/multiple-nics-vlans/compute-dvr.j2.yaml index 72f6f4d811..c6a6c26be8 100644 --- a/network/config/multiple-nics-vlans/compute-dvr.j2.yaml +++ b/network/config/multiple-nics-vlans/compute-dvr.j2.yaml @@ -79,120 +79,114 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: - get_param: ControlPlaneMtu - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - list_concat_unique: - - get_param: ControlPlaneStaticRoutes - - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: interface - name: nic2 - mtu: - get_param: StorageMtu - use_dhcp: false - - type: vlan - device: nic2 - mtu: - get_param: StorageMtu - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - routes: - get_param: StorageInterfaceRoutes - - type: interface - name: nic4 - mtu: - get_param: InternalApiMtu - use_dhcp: false - - type: vlan - device: nic4 - mtu: - get_param: InternalApiMtu - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - routes: - get_param: InternalApiInterfaceRoutes - - type: ovs_bridge - name: br-tenant - mtu: - get_param: TenantMtu - use_dhcp: false - addresses: - - ip_netmask: - get_param: TenantIpSubnet - routes: - get_param: TenantInterfaceRoutes - members: - - type: interface - name: nic5 - mtu: - get_param: TenantMtu - use_dhcp: false - primary: true - # External bridge for DVR (no IP address required) - - type: ovs_bridge - name: bridge_name - mtu: - get_param: ExternalMtu - dns_servers: - get_param: DnsServers - use_dhcp: false - members: - - type: interface - name: nic6 - mtu: - get_param: ExternalMtu - primary: true - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- type: interface - # name: nic7 - # mtu: - # get_param: ManagementMtu - # use_dhcp: false - # addresses: - # - ip_netmask: - # get_param: ManagementIpSubnet - # routes: - # list_concat_unique: - # - get_param: ManagementInterfaceRoutes - # - - default: true - # next_hop: - # get_param: ManagementInterfaceDefaultRoute + value: + network_config: + - type: interface + name: nic1 + mtu: + get_param: ControlPlaneMtu + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + list_concat_unique: + - get_param: ControlPlaneStaticRoutes + - - default: true + next_hop: + get_param: ControlPlaneDefaultRoute + - type: interface + name: nic2 + mtu: + get_param: StorageMtu + use_dhcp: false + - type: vlan + device: nic2 + mtu: + get_param: StorageMtu + vlan_id: + get_param: StorageNetworkVlanID + addresses: + - ip_netmask: + get_param: StorageIpSubnet + routes: + get_param: StorageInterfaceRoutes + - type: interface + name: nic4 + mtu: + get_param: InternalApiMtu + use_dhcp: false + - type: vlan + device: nic4 + mtu: + get_param: InternalApiMtu + vlan_id: + get_param: InternalApiNetworkVlanID + addresses: + - ip_netmask: + get_param: InternalApiIpSubnet + routes: + get_param: InternalApiInterfaceRoutes + - type: ovs_bridge + name: br-tenant + mtu: + get_param: TenantMtu + use_dhcp: false + addresses: + - ip_netmask: + get_param: TenantIpSubnet + routes: + get_param: TenantInterfaceRoutes + members: + - type: interface + name: nic5 + mtu: + get_param: TenantMtu + use_dhcp: false + primary: true + # External bridge for DVR (no IP address required) + - type: ovs_bridge + name: bridge_name + mtu: + get_param: ExternalMtu + dns_servers: + get_param: DnsServers + use_dhcp: false + members: + - type: interface + name: nic6 + mtu: + get_param: ExternalMtu + primary: true + # Uncomment when including environments/network-management.yaml + # If setting default route on the Management interface, comment + # out the default route on the Control Plane. + #- type: interface + # name: nic7 + # mtu: + # get_param: ManagementMtu + # use_dhcp: false + # addresses: + # - ip_netmask: + # get_param: ManagementIpSubnet + # routes: + # list_concat_unique: + # - get_param: ManagementInterfaceRoutes + # - - default: true + # next_hop: + # get_param: ManagementInterfaceDefaultRoute outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/network/config/multiple-nics-vlans/role.role.j2.yaml b/network/config/multiple-nics-vlans/role.role.j2.yaml index 39d2abe529..44ebc6395c 100644 --- a/network/config/multiple-nics-vlans/role.role.j2.yaml +++ b/network/config/multiple-nics-vlans/role.role.j2.yaml @@ -101,102 +101,96 @@ parameters: {%- endif %} resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: - get_param: ControlPlaneMtu - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - list_concat_unique: - - get_param: ControlPlaneStaticRoutes + value: + network_config: + - type: interface + name: nic1 + mtu: + get_param: ControlPlaneMtu + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + list_concat_unique: + - get_param: ControlPlaneStaticRoutes {%- if role.default_route_networks is not defined or 'ControlPlane' in role.default_route_networks %} - - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute + - - default: true + next_hop: + get_param: ControlPlaneDefaultRoute {%- endif %} {%- set nics_used = [1] %} {%- for network in networks if network.enabled|default(true) and network.name not in role.networks_skip_config|default([]) %} {%- if network.name not in ["External", "Tenant"] %} {%- if network.name in _role_networks %} - - type: interface - name: nic{{loop.index + 1}} - mtu: - get_param: {{network.name}}Mtu - use_dhcp: false - - type: vlan - device: nic{{loop.index + 1}} - mtu: - get_param: {{network.name}}Mtu - vlan_id: - get_param: {{network.name}}NetworkVlanID - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes + - type: interface + name: nic{{loop.index + 1}} + mtu: + get_param: {{network.name}}Mtu + use_dhcp: false + - type: vlan + device: nic{{loop.index + 1}} + mtu: + get_param: {{network.name}}Mtu + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute {%- endif %} {%- endif %} {#- We need bridge also for ComputeDVR and Computes with OVN #} {%- elif network.name in role.networks or 'external_bridge' in role.tags %} - - type: ovs_bridge + - type: ovs_bridge {%- if network.name == "External" %} - name: bridge_name + name: bridge_name {%- else %} - name: br-{{network.name_lower}} + name: br-{{network.name_lower}} {%- endif %} - mtu: - get_param: {{network.name}}Mtu - dns_servers: - get_param: DnsServers - use_dhcp: false - members: - - type: interface - name: nic{{loop.index + 1}} - mtu: - get_param: {{network.name}}Mtu - use_dhcp: false - primary: true + mtu: + get_param: {{network.name}}Mtu + dns_servers: + get_param: DnsServers + use_dhcp: false + members: + - type: interface + name: nic{{loop.index + 1}} + mtu: + get_param: {{network.name}}Mtu + use_dhcp: false + primary: true {%- if network.name in _role_networks %} - - type: vlan - mtu: - get_param: {{network.name}}Mtu - vlan_id: - get_param: {{network.name}}NetworkVlanID - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes + - type: vlan + mtu: + get_param: {{network.name}}Mtu + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute {%- endif %} {%- endif %} {%- endif %} @@ -204,28 +198,28 @@ resources: {%- set _ = nics_used.append(loop.index) %} {%- endfor %} {%- if role.name == 'ComputeOvsDpdk' %} - # Used as a provider network with external DHCP - - type: ovs_user_bridge - name: br-dpdk0 - members: - - type: ovs_dpdk_bond - name: dpdkbond0 - rx_queue: - get_param: NumDpdkInterfaceRxQueues - members: - - type: ovs_dpdk_port - name: dpdk0 - members: - - type: interface - name: nic{{nics_used[-1] + 1}} - - type: ovs_dpdk_port - name: dpdk1 - members: - - type: interface - name: nic{{nics_used[-1] + 2}} + # Used as a provider network with external DHCP + - type: ovs_user_bridge + name: br-dpdk0 + members: + - type: ovs_dpdk_bond + name: dpdkbond0 + rx_queue: + get_param: NumDpdkInterfaceRxQueues + members: + - type: ovs_dpdk_port + name: dpdk0 + members: + - type: interface + name: nic{{nics_used[-1] + 1}} + - type: ovs_dpdk_port + name: dpdk1 + members: + - type: interface + name: nic{{nics_used[-1] + 2}} {%- endif %} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/network/config/multiple-nics/compute-dvr.j2.yaml b/network/config/multiple-nics/compute-dvr.j2.yaml index 3d84e0e027..735e4e2d0b 100644 --- a/network/config/multiple-nics/compute-dvr.j2.yaml +++ b/network/config/multiple-nics/compute-dvr.j2.yaml @@ -79,108 +79,102 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: - get_param: ControlPlaneMtu - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - list_concat_unique: - - get_param: ControlPlaneStaticRoutes - - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: interface - name: nic2 - mtu: - get_param: StorageMtu - use_dhcp: false - addresses: - - ip_netmask: - get_param: StorageIpSubnet - routes: - get_param: StorageInterfaceRoutes - - type: interface - name: nic4 - mtu: - get_param: InternalApiMtu - use_dhcp: false - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - routes: - get_param: InternalApiInterfaceRoutes - - type: ovs_bridge - name: br-tenant - mtu: - get_param: TenantMtu - use_dhcp: false - addresses: - - ip_netmask: - get_param: TenantIpSubnet - routes: - get_param: TenantInterfaceRoutes - members: - - type: interface - name: nic5 - mtu: - get_param: TenantMtu - use_dhcp: false - primary: true - # External bridge for DVR (no IP address required) - - type: ovs_bridge - name: bridge_name - mtu: - get_param: ExternalMtu - dns_servers: - get_param: DnsServers - use_dhcp: false - members: - - type: interface - name: nic6 - mtu: - get_param: ExternalMtu - primary: true - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- type: interface - # name: nic7 - # mtu: - # get_param: ManagementMtu - # use_dhcp: false - # addresses: - # - ip_netmask: - # get_param: ManagementIpSubnet - # routes: - # list_concat_unique: - # - get_param: ManagementInterfaceRoutes - # - - default: true - # next_hop: - # get_param: ManagementInterfaceDefaultRoute + value: + network_config: + - type: interface + name: nic1 + mtu: + get_param: ControlPlaneMtu + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + list_concat_unique: + - get_param: ControlPlaneStaticRoutes + - - default: true + next_hop: + get_param: ControlPlaneDefaultRoute + - type: interface + name: nic2 + mtu: + get_param: StorageMtu + use_dhcp: false + addresses: + - ip_netmask: + get_param: StorageIpSubnet + routes: + get_param: StorageInterfaceRoutes + - type: interface + name: nic4 + mtu: + get_param: InternalApiMtu + use_dhcp: false + addresses: + - ip_netmask: + get_param: InternalApiIpSubnet + routes: + get_param: InternalApiInterfaceRoutes + - type: ovs_bridge + name: br-tenant + mtu: + get_param: TenantMtu + use_dhcp: false + addresses: + - ip_netmask: + get_param: TenantIpSubnet + routes: + get_param: TenantInterfaceRoutes + members: + - type: interface + name: nic5 + mtu: + get_param: TenantMtu + use_dhcp: false + primary: true + # External bridge for DVR (no IP address required) + - type: ovs_bridge + name: bridge_name + mtu: + get_param: ExternalMtu + dns_servers: + get_param: DnsServers + use_dhcp: false + members: + - type: interface + name: nic6 + mtu: + get_param: ExternalMtu + primary: true + # Uncomment when including environments/network-management.yaml + # If setting default route on the Management interface, comment + # out the default route on the Control Plane. + #- type: interface + # name: nic7 + # mtu: + # get_param: ManagementMtu + # use_dhcp: false + # addresses: + # - ip_netmask: + # get_param: ManagementIpSubnet + # routes: + # list_concat_unique: + # - get_param: ManagementInterfaceRoutes + # - - default: true + # next_hop: + # get_param: ManagementInterfaceDefaultRoute outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/network/config/multiple-nics/role.role.j2.yaml b/network/config/multiple-nics/role.role.j2.yaml index 57a5e361cb..9f9e6afda0 100644 --- a/network/config/multiple-nics/role.role.j2.yaml +++ b/network/config/multiple-nics/role.role.j2.yaml @@ -101,120 +101,114 @@ parameters: {%- endif %} resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: interface - name: nic1 - mtu: - get_param: ControlPlaneMtu - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - list_concat_unique: - - get_param: ControlPlaneStaticRoutes + value: + network_config: + - type: interface + name: nic1 + mtu: + get_param: ControlPlaneMtu + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + list_concat_unique: + - get_param: ControlPlaneStaticRoutes {%- if role.default_route_networks is not defined or 'ControlPlane' in role.default_route_networks %} - - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute + - - default: true + next_hop: + get_param: ControlPlaneDefaultRoute {%- endif %} {%- set nics_used = [1] %} {%- for network in networks if network.enabled|default(true) and network.name not in role.networks_skip_config|default([]) %} {%- if network.name not in ["External", "Tenant"] %} {%- if network.name in _role_networks %} - - type: interface - name: nic{{loop.index + 1}} - mtu: - get_param: {{network.name}}Mtu - use_dhcp: false - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes + - type: interface + name: nic{{loop.index + 1}} + mtu: + get_param: {{network.name}}Mtu + use_dhcp: false + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute {%- endif %} {%- endif %} {#- We need bridge also for ComputeDVR and Computes with OVN #} {%- elif network.name in _role_networks or 'external_bridge' in role.tags %} - - type: ovs_bridge + - type: ovs_bridge {%- if network.name == "External" %} - name: bridge_name + name: bridge_name {%- else %} - name: br-{{network.name_lower}} + name: br-{{network.name_lower}} {%- endif %} - mtu: - get_param: {{network.name}}Mtu - dns_servers: - get_param: DnsServers - use_dhcp: false + mtu: + get_param: {{network.name}}Mtu + dns_servers: + get_param: DnsServers + use_dhcp: false {%- if network.name in _role_networks %} - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute {%- endif %} {%- endif %} - members: - - type: interface - name: nic{{loop.index + 1}} - mtu: - get_param: {{network.name}}Mtu - use_dhcp: false - primary: true + members: + - type: interface + name: nic{{loop.index + 1}} + mtu: + get_param: {{network.name}}Mtu + use_dhcp: false + primary: true {%- endif %} {#- This hack gets around Jinja scope limitations to update nics_used within loop. #} {%- set _ = nics_used.append(loop.index) %} {%- endfor %} {%- if role.name == 'ComputeOvsDpdk' %} - # Used as a provider network with external DHCP - - type: ovs_user_bridge - name: br-dpdk0 - members: - - type: ovs_dpdk_bond - name: dpdkbond0 - rx_queue: - get_param: NumDpdkInterfaceRxQueues - members: - - type: ovs_dpdk_port - name: dpdk0 - members: - - type: interface - name: nic{{nics_used[-1] + 1}} - - type: ovs_dpdk_port - name: dpdk1 - members: - - type: interface - name: nic{{nics_used[-1] + 2}} + # Used as a provider network with external DHCP + - type: ovs_user_bridge + name: br-dpdk0 + members: + - type: ovs_dpdk_bond + name: dpdkbond0 + rx_queue: + get_param: NumDpdkInterfaceRxQueues + members: + - type: ovs_dpdk_port + name: dpdk0 + members: + - type: interface + name: nic{{nics_used[-1] + 1}} + - type: ovs_dpdk_port + name: dpdk1 + members: + - type: interface + name: nic{{nics_used[-1] + 2}} {%- endif %} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml b/network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml index f08a59a02b..b1673cd1e9 100644 --- a/network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml +++ b/network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml @@ -104,75 +104,69 @@ resources: {%- endfor %} OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: linux_bridge + value: + network_config: + - type: linux_bridge {%- if role.name.startswith('CephStorage') or role.name.startswith('ObjectStorage') or role.name.startswith('BlockStorage') %} - name: br-storage + name: br-storage {%- else %} - name: bridge_name + name: bridge_name {%- endif %} - mtu: - get_attr: [MinViableMtu, value] - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - list_concat_unique: - - get_param: ControlPlaneStaticRoutes + mtu: + get_attr: [MinViableMtu, value] + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + list_concat_unique: + - get_param: ControlPlaneStaticRoutes {%- if role.default_route_networks is not defined or 'ControlPlane' in role.default_route_networks %} - - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute + - - default: true + next_hop: + get_param: ControlPlaneDefaultRoute {%- endif %} - members: - - type: interface - name: interface_name - mtu: - get_attr: [MinViableMtu, value] - primary: true + members: + - type: interface + name: interface_name + mtu: + get_attr: [MinViableMtu, value] + primary: true {%- for network in networks if network.enabled|default(true) and network.name in _role_networks - and network.name not in role.networks_skip_config|default([]) %} - - type: vlan - mtu: - get_param: {{network.name}}Mtu - vlan_id: - get_param: {{network.name}}NetworkVlanID +and network.name not in role.networks_skip_config|default([]) %} + - type: vlan + mtu: + get_param: {{network.name}}Mtu + vlan_id: + get_param: {{network.name}}NetworkVlanID {%- if role.name.startswith('CephStorage') or role.name.startswith('ObjectStorage') or role.name.startswith('BlockStorage') %} - device: br-storage + device: br-storage {%- else %} - device: bridge_name + device: bridge_name {%- endif %} - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute {%- endif %} {%- endfor %} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/network/config/single-nic-vlans/controller-no-external.j2.yaml b/network/config/single-nic-vlans/controller-no-external.j2.yaml index a07e6cc887..6005a96db1 100644 --- a/network/config/single-nic-vlans/controller-no-external.j2.yaml +++ b/network/config/single-nic-vlans/controller-no-external.j2.yaml @@ -77,53 +77,47 @@ parameters: resources: OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: ovs_bridge - name: bridge_name - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - list_concat_unique: - - get_param: ControlPlaneStaticRoutes - - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true + value: + network_config: + - type: ovs_bridge + name: bridge_name + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + list_concat_unique: + - get_param: ControlPlaneStaticRoutes + - - default: true + next_hop: + get_param: ControlPlaneDefaultRoute + members: + - type: interface + name: nic1 + # force the MAC address of the bridge to this interface + primary: true {%- for network in networks if network.enabled|default(true) and network.name != 'External' %} - - type: vlan - vlan_id: - get_param: {{network.name}}NetworkVlanID - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - get_param: {{network.name}}InterfaceRoutes + - type: vlan + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + get_param: {{network.name}}InterfaceRoutes {%- endfor %} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/network/config/single-nic-vlans/role.role.j2.yaml b/network/config/single-nic-vlans/role.role.j2.yaml index 95e2bd57c8..f7fbcc9f84 100644 --- a/network/config/single-nic-vlans/role.role.j2.yaml +++ b/network/config/single-nic-vlans/role.role.j2.yaml @@ -104,70 +104,64 @@ resources: {%- endfor %} OsNetConfigImpl: - type: OS::Heat::SoftwareConfig + type: OS::Heat::Value properties: - group: script - config: - str_replace: - template: - get_file: ../../scripts/run-os-net-config.sh - params: - $network_config: - network_config: - - type: ovs_bridge + value: + network_config: + - type: ovs_bridge {%- if role.name.startswith('CephStorage') or role.name.startswith('ObjectStorage') or role.name.startswith('BlockStorage') %} - name: br-storage + name: br-storage {%- else %} - name: bridge_name + name: bridge_name {%- endif %} - mtu: - get_attr: [MinViableMtu, value] - use_dhcp: false - dns_servers: - get_param: DnsServers - domain: - get_param: DnsSearchDomains - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - list_concat_unique: - - get_param: ControlPlaneStaticRoutes + mtu: + get_attr: [MinViableMtu, value] + use_dhcp: false + dns_servers: + get_param: DnsServers + domain: + get_param: DnsSearchDomains + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + list_concat_unique: + - get_param: ControlPlaneStaticRoutes {%- if role.default_route_networks is not defined or 'ControlPlane' in role.default_route_networks %} - - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute + - - default: true + next_hop: + get_param: ControlPlaneDefaultRoute {%- endif %} - members: - - type: interface - name: nic1 - mtu: - get_attr: [MinViableMtu, value] - # force the MAC address of the bridge to this interface - primary: true + members: + - type: interface + name: nic1 + mtu: + get_attr: [MinViableMtu, value] + # force the MAC address of the bridge to this interface + primary: true {%- for network in networks if network.enabled|default(true) and network.name in _role_networks %} - - type: vlan - mtu: - get_param: {{network.name}}Mtu - vlan_id: - get_param: {{network.name}}NetworkVlanID - addresses: - - ip_netmask: - get_param: {{network.name}}IpSubnet - routes: - list_concat_unique: - - get_param: {{network.name}}InterfaceRoutes + - type: vlan + mtu: + get_param: {{network.name}}Mtu + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet + routes: + list_concat_unique: + - get_param: {{network.name}}InterfaceRoutes {%- if network.name in role.default_route_networks %} - - - default: true - next_hop: - get_param: {{network.name}}InterfaceDefaultRoute + - - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute {%- endif %} {%- endfor %} outputs: - OS::stack_id: + config: description: The OsNetConfigImpl resource. value: - get_resource: OsNetConfigImpl + get_attr: [OsNetConfigImpl, value] diff --git a/network/scripts/run-os-net-config.sh b/network/scripts/run-os-net-config.sh deleted file mode 100755 index 9be03d8df8..0000000000 --- a/network/scripts/run-os-net-config.sh +++ /dev/null @@ -1 +0,0 @@ -$network_config diff --git a/puppet/role.role.j2.yaml b/puppet/role.role.j2.yaml index 918bea13e9..b1b109caaa 100644 --- a/puppet/role.role.j2.yaml +++ b/puppet/role.role.j2.yaml @@ -676,7 +676,7 @@ outputs: description: Mapping of hostname to NetworkConfig resource value: map_replace: - - HOSTNAME: {get_resource: NetworkConfig} + - HOSTNAME: {get_attr: [NetworkConfig, config]} - keys: HOSTNAME: {get_attr:[{{server_resource_name}}, name]} hosts_entry: diff --git a/tools/merge-new-params-nic-config-script.py b/tools/merge-new-params-nic-config-script.py index a8a6e2efa9..0e65152b58 100755 --- a/tools/merge-new-params-nic-config-script.py +++ b/tools/merge-new-params-nic-config-script.py @@ -60,8 +60,6 @@ def parse_opts(argv): return opts -# FIXME: This duplicates code from tools/yaml-nic-config-2-script.py, we should -# refactor to share the common code def to_commented_yaml(filename): """Convert comments into 'comments: ...' YAML""" @@ -106,8 +104,6 @@ def to_commented_yaml(filename): return out_str -# FIXME: This duplicates code from tools/yaml-nic-config-2-script.py, we should -# refactor to share the common code def to_normal_yaml(filename): """Convert back to normal #commented YAML""" diff --git a/tools/yaml-nic-config-2-script.py b/tools/yaml-nic-config-2-script.py deleted file mode 100755 index 9a74487e20..0000000000 --- a/tools/yaml-nic-config-2-script.py +++ /dev/null @@ -1,294 +0,0 @@ -#!/usr/bin/env python3 -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import argparse -import collections -import datetime -import os -import re -import shutil -import six -import sys -import traceback -import yaml - - -def parse_opts(argv): - parser = argparse.ArgumentParser( - description='Convert an old style NIC config file into the new format ' - 'using run-os-net-config.sh') - parser.add_argument('--script-dir', metavar='