Browse Source

Replace bridge_name and interface_name in config

The new ansible os_net_config does not replace the interface_name
and bridge_name variables in net config. This replaces those
variables beforehand.

Though it would have been good to handle it in module itself, in
the proposed way to generate these configs with ansible would
allow us to replace them with group_vars.

Change-Id: I2049d3ce2ad10507fd846d3876e20cc3ec4b9fbe
Closes-Bug: #1896829
changes/32/753932/1
Rabi Mishra 9 months ago
parent
commit
b2d3c05f4e
16 changed files with 112 additions and 25 deletions
  1. +6
    -1
      net-config-bond.j2.yaml
  2. +11
    -2
      net-config-bridge.j2.yaml
  3. +10
    -3
      net-config-linux-bridge.j2.yaml
  4. +10
    -2
      net-config-static-bridge-with-external-dhcp.j2.yaml
  5. +10
    -2
      net-config-static-bridge.j2.yaml
  6. +5
    -2
      net-config-static.j2.yaml
  7. +5
    -2
      network/config/2-linux-bonds-vlans/role.role.j2.yaml
  8. +6
    -1
      network/config/bond-with-vlans/controller-no-external.j2.yaml
  9. +6
    -1
      network/config/bond-with-vlans/role.role.j2.yaml
  10. +5
    -1
      network/config/multiple-nics-vlans/compute-dvr.j2.yaml
  11. +6
    -1
      network/config/multiple-nics-vlans/role.role.j2.yaml
  12. +5
    -1
      network/config/multiple-nics/compute-dvr.j2.yaml
  13. +6
    -1
      network/config/multiple-nics/role.role.j2.yaml
  14. +11
    -3
      network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml
  15. +5
    -1
      network/config/single-nic-vlans/controller-no-external.j2.yaml
  16. +5
    -1
      network/config/single-nic-vlans/role.role.j2.yaml

+ 6
- 1
net-config-bond.j2.yaml View File

@ -72,6 +72,11 @@ parameters:
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{%- endfor %}
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
type: OS::Heat::Value
@ -79,7 +84,7 @@ resources:
value:
network_config:
- type: ovs_bridge
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
use_dhcp: true
dns_servers:
get_param: DnsServers


+ 11
- 2
net-config-bridge.j2.yaml View File

@ -70,6 +70,15 @@ parameters:
description: Vlan ID for the {{network.name_lower}} network traffic.
type: number
{%- endfor %}
NeutronPublicInterface:
default: nic1
description: Which interface to add to the NeutronPhysicalBridge.
type: string
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
type: OS::Heat::Value
@ -77,7 +86,7 @@ resources:
value:
network_config:
- type: ovs_bridge
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
use_dhcp: true
dns_servers:
get_param: DnsServers
@ -85,7 +94,7 @@ resources:
get_param: DnsSearchDomains
members:
- type: interface
name: interface_name
name: {get_param: NeutronPublicInterface}
# force the MAC address of the bridge to this interface
primary: true
outputs:


+ 10
- 3
net-config-linux-bridge.j2.yaml View File

@ -70,7 +70,14 @@ parameters:
default: []
description: A list of DNS search domains to be added (in order) to resolv.conf.
type: comma_delimited_list
NeutronPublicInterface:
default: nic1
description: Which interface to add to the NeutronPhysicalBridge.
type: string
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
@ -79,7 +86,7 @@ resources:
value:
network_config:
- type: linux_bridge
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
addresses:
- ip_netmask:
get_param: ControlPlaneIp
@ -89,7 +96,7 @@ resources:
get_param: DnsSearchDomains
members:
- type: interface
name: interface_name
name: {get_param: NeutronPublicInterface}
# force the MAC address of the bridge to this interface
primary: true
routes:


+ 10
- 2
net-config-static-bridge-with-external-dhcp.j2.yaml View File

@ -71,6 +71,14 @@ parameters:
default: []
description: A list of DNS search domains to be added (in order) to resolv.conf.
type: comma_delimited_list
NeutronPublicInterface:
default: nic1
description: Which interface to add to the NeutronPhysicalBridge.
type: string
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
@ -79,7 +87,7 @@ resources:
value:
network_config:
- type: ovs_bridge
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
use_dhcp: true
dns_servers:
get_param: DnsServers
@ -87,7 +95,7 @@ resources:
get_param: DnsSearchDomains
members:
- type: interface
name: interface_name
name: {get_param: NeutronPublicInterface}
# force the MAC address of the bridge to this interface
primary: true
- type: interface


+ 10
- 2
net-config-static-bridge.j2.yaml View File

@ -71,6 +71,14 @@ parameters:
default: []
description: A list of DNS search domains to be added (in order) to resolv.conf.
type: comma_delimited_list
NeutronPublicInterface:
default: nic1
description: Which interface to add to the NeutronPhysicalBridge.
type: string
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
@ -79,7 +87,7 @@ resources:
value:
network_config:
- type: ovs_bridge
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
use_dhcp: false
dns_servers:
get_param: DnsServers
@ -97,7 +105,7 @@ resources:
get_param: ControlPlaneDefaultRoute
members:
- type: interface
name: interface_name
name: {get_param: NeutronPublicInterface}
# force the MAC address of the bridge to this interface
primary: true
outputs:


+ 5
- 2
net-config-static.j2.yaml View File

@ -70,6 +70,10 @@ parameters:
default: []
description: A list of DNS search domains to be added (in order) to resolv.conf.
type: comma_delimited_list
NeutronPublicInterface:
default: nic1
description: Which interface to add to the NeutronPhysicalBridge.
type: string
resources:
OsNetConfigImpl:
@ -78,7 +82,7 @@ resources:
value:
network_config:
- type: interface
name: interface_name
name: {get_param: NeutronPublicInterface}
use_dhcp: false
dns_servers:
get_param: DnsServers
@ -99,4 +103,3 @@ outputs:
description: The OsNetConfigImpl resource.
get_attr:
get_attr: [OsNetConfigImpl, value]

+ 5
- 2
network/config/2-linux-bonds-vlans/role.role.j2.yaml View File

@ -98,7 +98,10 @@ parameters:
default: 1
type: number
{%- endif %}
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
@ -202,7 +205,7 @@ resources:
{%- endfor %}
{%- if not role.name.startswith('ComputeOvsDpdk') %}
- type: ovs_bridge
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
dns_servers:
get_param: DnsServers
members:


+ 6
- 1
network/config/bond-with-vlans/controller-no-external.j2.yaml View File

@ -80,6 +80,11 @@ parameters:
interface. Set things like lacp=active and/or bond_mode=balance-slb
for OVS bonds or like mode=4 for Linux bonds using this option.'
type: string
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
type: OS::Heat::Value
@ -106,7 +111,7 @@ resources:
next_hop:
get_param: ControlPlaneDefaultRoute
- type: ovs_bridge
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
use_dhcp: true
members:
- type: ovs_bond


+ 6
- 1
network/config/bond-with-vlans/role.role.j2.yaml View File

@ -95,6 +95,11 @@ parameters:
default: 1
type: number
{%- endif %}
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
MinViableMtu:
@ -143,7 +148,7 @@ resources:
{%- if role.name.startswith('CephStorage') or role.name.startswith('ObjectStorage') or role.name.startswith('BlockStorage') %}
name: br-bond
{%- else %}
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
{%- endif %}
dns_servers:
get_param: DnsServers


+ 5
- 1
network/config/multiple-nics-vlans/compute-dvr.j2.yaml View File

@ -76,6 +76,10 @@ parameters:
default: []
description: A list of DNS search domains to be added (in order) to resolv.conf.
type: comma_delimited_list
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
@ -155,7 +159,7 @@ resources:
primary: true
# External bridge for DVR (no IP address required)
- type: ovs_bridge
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
mtu:
get_param: ExternalMtu
dns_servers:


+ 6
- 1
network/config/multiple-nics-vlans/role.role.j2.yaml View File

@ -99,6 +99,11 @@ parameters:
default: 1
type: number
{%- endif %}
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
type: OS::Heat::Value
@ -159,7 +164,7 @@ resources:
{%- elif network.name in role.networks or 'external_bridge' in role.tags %}
- type: ovs_bridge
{%- if network.name == "External" %}
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
{%- else %}
name: br-{{network.name_lower}}
{%- endif %}


+ 5
- 1
network/config/multiple-nics/compute-dvr.j2.yaml View File

@ -76,6 +76,10 @@ parameters:
default: []
description: A list of DNS search domains to be added (in order) to resolv.conf.
type: comma_delimited_list
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
@ -143,7 +147,7 @@ resources:
primary: true
# External bridge for DVR (no IP address required)
- type: ovs_bridge
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
mtu:
get_param: ExternalMtu
dns_servers:


+ 6
- 1
network/config/multiple-nics/role.role.j2.yaml View File

@ -99,6 +99,11 @@ parameters:
default: 1
type: number
{%- endif %}
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
type: OS::Heat::Value
@ -153,7 +158,7 @@ resources:
{%- elif network.name in _role_networks or 'external_bridge' in role.tags %}
- type: ovs_bridge
{%- if network.name == "External" %}
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
{%- else %}
name: br-{{network.name_lower}}
{%- endif %}


+ 11
- 3
network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml View File

@ -83,6 +83,14 @@ parameters:
default: []
description: A list of DNS search domains to be added (in order) to resolv.conf.
type: comma_delimited_list
NeutronPublicInterface:
default: nic1
description: Which interface to add to the NeutronPhysicalBridge.
type: string
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
@ -112,7 +120,7 @@ resources:
{%- if role.name.startswith('CephStorage') or role.name.startswith('ObjectStorage') or role.name.startswith('BlockStorage') %}
name: br-storage
{%- else %}
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
{%- endif %}
mtu:
get_attr: [MinViableMtu, value]
@ -137,7 +145,7 @@ resources:
{%- endif %}
members:
- type: interface
name: interface_name
name: {get_param: NeutronPublicInterface}
mtu:
get_attr: [MinViableMtu, value]
primary: true
@ -151,7 +159,7 @@ and network.name not in role.networks_skip_config|default([]) %}
{%- if role.name.startswith('CephStorage') or role.name.startswith('ObjectStorage') or role.name.startswith('BlockStorage') %}
device: br-storage
{%- else %}
device: bridge_name
device: {get_param: NeutronPhysicalBridge}
{%- endif %}
addresses:
- ip_netmask:


+ 5
- 1
network/config/single-nic-vlans/controller-no-external.j2.yaml View File

@ -74,6 +74,10 @@ parameters:
default: []
description: A list of DNS search domains to be added (in order) to resolv.conf.
type: comma_delimited_list
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
OsNetConfigImpl:
@ -82,7 +86,7 @@ resources:
value:
network_config:
- type: ovs_bridge
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
use_dhcp: false
dns_servers:
get_param: DnsServers


+ 5
- 1
network/config/single-nic-vlans/role.role.j2.yaml View File

@ -83,6 +83,10 @@ parameters:
default: []
description: A list of DNS search domains to be added (in order) to resolv.conf.
type: comma_delimited_list
NeutronPhysicalBridge:
default: 'br-ex'
description: An OVS bridge to create for accessing external networks.
type: string
resources:
@ -112,7 +116,7 @@ resources:
{%- if role.name.startswith('CephStorage') or role.name.startswith('ObjectStorage') or role.name.startswith('BlockStorage') %}
name: br-storage
{%- else %}
name: bridge_name
name: {get_param: NeutronPhysicalBridge}
{%- endif %}
mtu:
get_attr: [MinViableMtu, value]


Loading…
Cancel
Save