Browse Source

networks_lower group_var replace role_networks_lower

The 'networks_lower' group_var carries a mapping of
network.name to network.name_lower for all networks.

The external_bridge interface on DVR compute nodes
that do not have the 'External' network associated
with the role still need to be able to lookup the
name_lower for the 'External' network.

The lookup via role_networks_lower fail's since the
'External' network is'nt associated.

Also if the 'External' network is associated with the
role set the address and routes.

For the mutliple_nic_vlans add address and routes and
the vlan member interface on the bridge.

Note, also remove duplicate name entry on the 'Tenant'
network section.

Depends-On: https://review.opendev.org/763301
Closes-Bug: #1904809
Change-Id: I19a011bfbbcdbacbe257625310490077755a8b70
changes/02/763302/8
Harald Jensås 5 months ago
parent
commit
2fe1c59d9e
2 changed files with 39 additions and 24 deletions
  1. +16
    -10
      tripleo_ansible/roles/tripleo_network_config/templates/multiple_nics/multiple_nics_dvr.j2
  2. +23
    -14
      tripleo_ansible/roles/tripleo_network_config/templates/multiple_nics_vlans/multiple_nics_vlans_dvr.j2

+ 16
- 10
tripleo_ansible/roles/tripleo_network_config/templates/multiple_nics/multiple_nics_dvr.j2 View File

@ -14,26 +14,26 @@ network_config:
{% if network not in ["External", "Tenant"] %}
- type: interface
name: nic{{ loop.index +1 }}
mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
use_dhcp: false
addresses:
- ip_netmask:
{{ lookup('vars', role_networks_lower[network] ~ '_ip') }}/{{ lookup('vars', role_networks_lower[network] ~ '_cidr') }}
routes: {{ lookup('vars', role_networks_lower[network] ~ '_host_routes') }}
{{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }}
routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }}
{% elif network == 'Tenant' %}
- type: ovs_bridge
name: {{ 'br-' ~ role_networks_lower[network] }}
mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
name: {{ 'br-' ~ networks_lower[network] }}
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
dns_servers: {{ ctlplane_dns_nameservers }}
use_dhcp: false
addresses:
- ip_netmask:
{{ lookup('vars', role_networks_lower[network] ~ '_ip') }}/{{ lookup('vars', role_networks_lower[network] ~ '_cidr') }}
routes: {{ lookup('vars', role_networks_lower[network] ~ '_host_routes') }}
{{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }}
routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }}
members:
- type: interface
name: nic{{loop.index + 1}}
mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
use_dhcp: false
primary: true
{% endif %}
@ -41,11 +41,17 @@ network_config:
{% endfor %}
- type: ovs_bridge
name: {{ neutron_physical_bridge_name }}
mtu: {{ lookup('vars', role_networks_lower['External'] ~ '_mtu') }}
mtu: {{ lookup('vars', networks_lower['External'] ~ '_mtu') }}
dns_servers: {{ ctlplane_dns_nameservers }}
use_dhcp: false
{% if 'External' in role_networks %}
addresses:
- ip_netmask:
{{ lookup('vars', networks_lower['External'] ~ '_ip') }}/{{ lookup('vars', networks_lower['External'] ~ '_cidr') }}
routes: {{ lookup('vars', networks_lower['External'] ~ '_host_routes') }}
{% endif %}
members:
- type: interface
name: nic{{nics_used[-1] + 1}}
mtu: {{ lookup('vars', role_networks_lower['External'] ~ '_mtu') }}
mtu: {{ lookup('vars', networks_lower['External'] ~ '_mtu') }}
primary: true

+ 23
- 14
tripleo_ansible/roles/tripleo_network_config/templates/multiple_nics_vlans/multiple_nics_vlans_dvr.j2 View File

@ -14,45 +14,54 @@ network_config:
{% if network not in ["External", "Tenant"] %}
- type: interface
name: nic{{ loop.index + 1 }}
mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
use_dhcp: false
- type: vlan
device: nic{{ loop.index + 1 }}
mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
vlan_id: {{ lookup('vars', role_networks_lower[network] ~ '_vlan_id') }}
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
addresses:
- ip_netmask:
{{ lookup('vars', role_networks_lower[network] ~ '_ip') }}/{{ lookup('vars', role_networks_lower[network] ~ '_cidr') }}
routes: {{ lookup('vars', role_networks_lower[network] ~ '_host_routes') }}
{{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }}
routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }}
{% elif network == 'Tenant' %}
- type: ovs_bridge
name: {{ 'br-' ~ role_networks_lower[network] }}
mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
name: {{ 'br-' ~ networks_lower[network] }}
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
dns_servers: {{ ctlplane_dns_nameservers }}
use_dhcp: false
members:
- type: interface
name: nic{{ loop.index + 1 }}
mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
use_dhcp: false
primary: true
- type: vlan
mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
vlan_id: {{ lookup('vars', role_networks_lower[network] ~ '_vlan_id') }}
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
addresses:
- ip_netmask:
{{ lookup('vars', role_networks_lower[network] ~ '_ip') }}/{{ lookup('vars', role_networks_lower[network] ~ '_cidr') }}
routes: {{ lookup('vars', role_networks_lower[network] ~ '_host_routes') }}
{{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }}
routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }}
{% endif %}
{% set _ = nics_used.append(loop.index) %}
{% endfor %}
- type: ovs_bridge
name: {{ neutron_physical_bridge_name }}
mtu: {{ lookup('vars', role_networks_lower['External'] ~ '_mtu') }}
mtu: {{ lookup('vars', networks_lower['External'] ~ '_mtu') }}
dns_servers: {{ ctlplane_dns_nameservers }}
use_dhcp: false
members:
- type: interface
name: nic{{nics_used[-1] + 1}}
mtu: {{ lookup('vars', role_networks_lower['External'] ~ '_mtu') }}
mtu: {{ lookup('vars', networks_lower['External'] ~ '_mtu') }}
primary: true
{% if 'External' in role_networks %}
- type: vlan
mtu: {{ lookup('vars', networks_lower['External'] ~ '_mtu') }}
vlan_id: {{ lookup('vars', networks_lower['External'] ~ '_vlan_id') }}
addresses:
- ip_netmask:
{{ lookup('vars', networks_lower['External'] ~ '_ip') }}/{{ lookup('vars', networks_lower['External'] ~ '_cidr') }}
routes: {{ lookup('vars', networks_lower['External'] ~ '_host_routes') }}
{% endif %}

Loading…
Cancel
Save