
Correction of tunnel_types config option in values.yaml, regarding the _openvswitch_agent.ini.tpl layout. Added bridge mappings, since it was lost with auto-generate configs. Removed br-physnet1 and physnet1 in favor of 'external' network config. Removed default network interface, replacing it with search for interface with default gateway for tunneling. The interface for external bridge has to be defined explicitly, otherwise no interface will be added to external bridge automatically. In OVS configuration scripts, added handling null port passed. Change-Id: I90ebe222323b3b1ec8d20a8038c0dfed3de9b58c Closes-Bug: #1686365 Closes-Bug: #1686367
49 lines
1.9 KiB
Smarty
49 lines
1.9 KiB
Smarty
#!/bin/bash
|
|
|
|
# Copyright 2017 The Openstack-Helm Authors.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
set -x
|
|
chown neutron: /run/openvswitch/db.sock
|
|
|
|
# ensure we can talk to openvswitch or bail early
|
|
# this is until we can setup a proper dependency
|
|
# on deaemonsets - note that a show is not sufficient
|
|
# here, we need to communicate with both the db and vswitchd
|
|
# which means we need to do a create action
|
|
#
|
|
# see https://github.com/att-comdev/openstack-helm/issues/88
|
|
timeout 3m neutron-sanity-check --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/openvswitch_agent.ini --ovsdb_native --nokeepalived_ipv6_support
|
|
|
|
tunnel_interface={{ .Values.network.interface.tunnel }}
|
|
if [ not $tunnel_interface ] ; then
|
|
# search for interface with default routing
|
|
tunnel_interface=$(ip r | grep default | grep -oP '(?<=dev ).*')
|
|
fi
|
|
|
|
# determine local-ip dynamically based on interface provided but only if tunnel_types is not null
|
|
IP=$(ip a s $tunnel_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}')
|
|
cat <<EOF>/tmp/ml2-local-ip.ini
|
|
[ovs]
|
|
local_ip = $IP
|
|
EOF
|
|
|
|
# TODO: make this configurable going forward as today
|
|
# it forces openvswitch agent
|
|
exec sudo -E -u neutron neutron-openvswitch-agent \
|
|
--config-file /etc/neutron/neutron.conf \
|
|
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini \
|
|
--config-file /tmp/ml2-local-ip.ini \
|
|
--config-file /etc/neutron/plugins/ml2/openvswitch_agent.ini
|