Issue where in default network_settings, api_network is not specified.
This means that the settings do not have api_network in its output, but
the nic template checks to see if api_network vlan is native in its
logic. This patch assumes a vlan will be numeric. A blank value or a
value of 'native' will not be numeric therefore default is expanded to
allow blank values as non-vlan networks.
Also fixes controller to always have br-ex.
Change-Id: Ibebb231901e653127175aef194eec708e8507da2
Signed-off-by: Tim Rozet <trozet@redhat.com>
Signed-off-by: Dan Radez <dradez@redhat.com>
Signed-off-by: Tim Rozet <trozet@redhat.com>
os_net_config:
network_config:
-
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 %}
type: ovs_bridge
name: {get_input: bridge_name}
members:
type: ovs_bridge
name: {get_input: bridge_name}
members:
name: nic1
# force the MAC address of the bridge to this interface
primary: true
name: nic1
# 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['private_network'] is number %}
-
type: vlan
vlan_id: {get_param: ExternalNetworkVlanID}
-
type: vlan
vlan_id: {get_param: ExternalNetworkVlanID}
default: true
next_hop: {get_param: ExternalInterfaceDefaultRoute}
{%- endif %}
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}
-
type: vlan
vlan_id: {get_param: TenantNetworkVlanID}
-
ip_netmask: {get_param: TenantIpSubnet}
{%- endif %}
-
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}
-
type: vlan
vlan_id: {get_param: StorageNetworkVlanID}
-
ip_netmask: {get_param: StorageIpSubnet}
{%- endif %}
-
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}
-
type: vlan
vlan_id: {get_param: InternalApiNetworkVlanID}
name: nic{{ nic_index }}{% set nic_index = nic_index + 1 %}
# force the MAC address of the bridge to this interface
primary: true
name: nic{{ nic_index }}{% set nic_index = nic_index + 1 %}
# 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' %}
-
{%- endif %}
{%- if 'storage_network' in enabled_networks and vlans['storage_network'] == 'native' %}
-
- if ! controller_nic_template=$(python3.4 -B $LIB/python/apex-python-utils.py nic-template -r controller -s $NETSETS -i $net_isolation_enabled -t $CONFIG/nics-template.yaml.jinja2 -n "$enabled_network_list" -e $ext_net_type -af $ip_addr_family); then
+ if ! controller_nic_template=$(python3.4 -B $LIB/python/apex-python-utils.py nic-template -r controller -s $NETSETS -i $net_isolation_enabled -t $CONFIG/nics-template.yaml.jinja2 -n "$enabled_network_list" -e "br-ex" -af $ip_addr_family); then
echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}"
exit 1
fi
echo -e "${red}ERROR: Failed to generate controller NIC heat template ${reset}"
exit 1
fi