X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=build%2Fnics-template.yaml.jinja2;h=0680a26f948c8c038df5f709aef196a692e061e3;hb=49dee15b86abd925b7723471013a8911ca88d9ba;hp=bdf26cb0a25ebc12c3fbce8c7dfd8b4e074312c0;hpb=ec53529b33c22eb54f6d9af5aa14e4ef74340963;p=apex.git diff --git a/build/nics-template.yaml.jinja2 b/build/nics-template.yaml.jinja2 index bdf26cb0..0680a26f 100644 --- a/build/nics-template.yaml.jinja2 +++ b/build/nics-template.yaml.jinja2 @@ -85,16 +85,16 @@ resources: os_net_config: network_config: - - {%- if vlans['private_network'] != 'native' or vlans['storage_network'] != 'native' or vlans['api_network'] != 'native' %} + {%- if vlans['private_network'] is number or vlans['storage_network'] is number or vlans['api_network'] is number or vlans['public_network'] is number %} type: ovs_bridge name: {get_input: bridge_name} members: - type: interface - name: nic1 + name: {{ nics[role]['admin_network'] }} # force the MAC address of the bridge to this interface primary: true - {%- if 'public_network' in enabled_networks and vlans['private_network'] != 'native' %} + {%- if 'public_network' in enabled_networks and vlans['public_network'] is number %} - type: vlan vlan_id: {get_param: ExternalNetworkVlanID} @@ -106,7 +106,7 @@ resources: default: true next_hop: {get_param: ExternalInterfaceDefaultRoute} {%- endif %} - {%- if 'private_network' in enabled_networks and vlans['private_network'] != 'native' %} + {%- if 'private_network' in enabled_networks and vlans['private_network'] is number %} - type: vlan vlan_id: {get_param: TenantNetworkVlanID} @@ -114,7 +114,7 @@ resources: - ip_netmask: {get_param: TenantIpSubnet} {%- endif %} - {%- if 'storage_network' in enabled_networks and vlans['storage_network'] != 'native' %} + {%- if 'storage_network' in enabled_networks and vlans['storage_network'] is number %} - type: vlan vlan_id: {get_param: StorageNetworkVlanID} @@ -122,7 +122,7 @@ resources: - ip_netmask: {get_param: StorageIpSubnet} {%- endif %} - {%- if 'api_network' in enabled_networks and vlans['api_network'] != 'native' %} + {%- if 'api_network' in enabled_networks and vlans['api_network'] is number %} - type: vlan vlan_id: {get_param: InternalApiNetworkVlanID} @@ -132,7 +132,7 @@ resources: {%- endif %} {%- else %} type: interface - name: nic1 + name: {{ nics[role]['admin_network'] }} {%- endif %} use_dhcp: false dns_servers: {get_param: DnsServers} @@ -153,14 +153,8 @@ resources: next_hop: {get_param: ControlPlaneDefaultRoute} {%- endif %} - {%- set nic_index = 2 %} {%- if 'private_network' in enabled_networks and vlans['private_network'] == 'native' %} - {%- if ovs_dpdk_bridge == 'br-phy' %} - - - type: interface - name: nic{{ nic_index }}{% set nic_index = nic_index + 1 %} - use_dhcp: false - + {%- if ovs_dpdk_bridge == 'br-phy' and role == 'compute' %} - type: ovs_bridge name: {{ ovs_dpdk_bridge }} @@ -168,6 +162,12 @@ resources: addresses: - ip_netmask: {get_param: TenantIpSubnet} + members: + - + type: interface + name: {{ nics[role]['private_network'] }} + # force the MAC address of the bridge to this interface + primary: true - type: ovs_bridge name: br-tun @@ -175,7 +175,7 @@ resources: {%- else %} - type: interface - name: nic{{ nic_index }}{% set nic_index = nic_index + 1 %} + name: {{ nics[role]['private_network'] }} use_dhcp: false addresses: - @@ -185,7 +185,7 @@ resources: {%- if 'public_network' in enabled_networks and external_net_type == 'interface' and vlans['public_network'] == 'native' %} - type: interface - name: nic{{ nic_index }}{% set nic_index = nic_index + 1 %} + name: {{ nics[role]['public_network'] }} {%- if role == 'controller' %} dns_servers: {get_param: DnsServers} {%- endif %} @@ -208,14 +208,25 @@ resources: members: - type: interface - name: nic{{ nic_index }}{% set nic_index = nic_index + 1 %} + name: {{ nics[role]['public_network'] }} # force the MAC address of the bridge to this interface primary: true + {%- if role == 'controller' %} + dns_servers: {get_param: DnsServers} + addresses: + - + ip_netmask: {get_param: ExternalIpSubnet} + routes: + - + default: true + ip_netmask: 0.0.0.0/0 + next_hop: {get_param: ExternalInterfaceDefaultRoute} + {%- endif %} {%- endif %} {%- if 'storage_network' in enabled_networks and vlans['storage_network'] == 'native' %} - type: interface - name: nic{{ nic_index }}{% set nic_index = nic_index + 1 %} + name: {{ nics[role]['storage_network'] }} use_dhcp: false addresses: - @@ -224,7 +235,7 @@ resources: {%- if 'api_network' in enabled_networks and vlans['api_network'] == 'native' %} - type: interface - name: nic{{ nic_index }}{% set nic_index = nic_index + 1 %} + name: {{ nics[role]['api_network'] }} use_dhcp: false addresses: -