Browse Source

Add nic config for single-nic-linux-bridge-vlans

This adds native nic config templates for deployments
using single-nic-linux-bridge-vlans.

Change-Id: I3f7eda673e2e2ba5f81f319d0d3726883909036e
changes/40/756240/2
Rabi Mishra 2 years ago
parent
commit
5103a6d3af
  1. 41
      tripleo_ansible/roles/tripleo_network_config/templates/single_nic_linux_bridge_vlans/single_nic_linux_bridge_vlans.j2
  2. 41
      tripleo_ansible/roles/tripleo_network_config/templates/single_nic_linux_bridge_vlans/single_nic_linux_bridge_vlans_storage.j2

41
tripleo_ansible/roles/tripleo_network_config/templates/single_nic_linux_bridge_vlans/single_nic_linux_bridge_vlans.j2

@ -0,0 +1,41 @@
---
{% set mtu_list = [ctlplane_mtu] %}
{% for network in role_networks %}
{{ mtu_list.append(lookup('vars', role_networks_lower[network] ~ '_mtu')) }}
{%- endfor %}
{% set min_viable_mtu = mtu_list | max %}
network_config:
- type: linux_bridge
name: {{ neutron_physical_bridge_name }}
mtu: {{ min_viable_mtu }}
use_dhcp: false
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
{% if not default_route_networks or 'ControlPlane' in default_route_networks %}
routes: {{ ctlplane_host_routes + [{'default': true, 'next_hop': ctlplane_gateway_ip}] }}
{% else %}
routes: {{ ctlplane_host_routes }}
{% endif %}
members:
- type: interface
name: {{ neutron_public_interface_name }}
mtu: {{ min_viable_mtu }}
# force the MAC address of the bridge to this interface
primary: true
{% for network in role_networks and network not in networks_skip_config|default([]) %}
- type: vlan
mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
vlan_id: {{ lookup('vars', role_networks_lower[network] ~ '_vlan_id') }}
device: {{ neutron_physical_bridge_name }}
addresses:
- ip_netmask:
{{ lookup('vars', role_networks_lower[network] ~ '_ip') }}/{{ lookup('vars', role_networks_lower[network] ~ '_cidr') }}
{% if default_route_networks and network in default_route_networks %}
routes:
{{ lookup('vars', role_networks_lower[network] ~ '_host_routes') + [{'default': true, 'next_hop': lookup('vars', role_networks_lower[network] ~ '_gateway_ip')}] }}
{% else %}
routes: {{ lookup('vars', role_networks_lower[network] ~ '_host_routes') }}
{% endif %}
{% endfor %}

41
tripleo_ansible/roles/tripleo_network_config/templates/single_nic_linux_bridge_vlans/single_nic_linux_bridge_vlans_storage.j2

@ -0,0 +1,41 @@
---
{% set mtu_list = [ctlplane_mtu] %}
{% for network in role_networks %}
{{ mtu_list.append(lookup('vars', role_networks_lower[network] ~ '_mtu')) }}
{%- endfor %}
{% set min_viable_mtu = mtu_list | max %}
network_config:
- type: linux_bridge
name: br-storage
mtu: {{ min_viable_mtu }}
use_dhcp: false
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
{% if not default_route_networks or 'ControlPlane' in default_route_networks %}
routes: {{ ctlplane_host_routes + [{'default': true, 'next_hop': ctlplane_gateway_ip}] }}
{% else %}
routes: {{ ctlplane_host_routes }}
{% endif %}
members:
- type: interface
name: {{ neutron_public_interface_name }}
mtu: {{ min_viable_mtu }}
# force the MAC address of the bridge to this interface
primary: true
{% for network in role_networks and network not in networks_skip_config|default([]) %}
- type: vlan
mtu: {{ lookup('vars', role_networks_lower[network] ~ '_mtu') }}
vlan_id: {{ lookup('vars', role_networks_lower[network] ~ '_vlan_id') }}
device: br-storage
addresses:
- ip_netmask:
{{ lookup('vars', role_networks_lower[network] ~ '_ip') }}/{{ lookup('vars', role_networks_lower[network] ~ '_cidr') }}
{% if default_route_networks and network in default_route_networks %}
routes:
{{ lookup('vars', role_networks_lower[network] ~ '_host_routes') + [{'default': true, 'next_hop': lookup('vars', role_networks_lower[network] ~ '_gateway_ip')}] }}
{% else %}
routes: {{ lookup('vars', role_networks_lower[network] ~ '_host_routes') }}
{% endif %}
{% endfor %}
Loading…
Cancel
Save