From d1673ad173ea96c0e018946f54caa99776855cc1 Mon Sep 17 00:00:00 2001
From: Paul Bourke <paul.bourke@oracle.com>
Date: Tue, 20 Sep 2016 17:07:55 +0100
Subject: [PATCH] Allow operators to provision multiple physical networks

Currently Kolla operators are restricted to configuring one physical
network (physnet1).

This change along with ml2_conf.ini augmentation can be used to setup
multiple physical networks in openvswitch.

E.g. To configure two physical networks, physnet1 and physnet2, with
ports eth1 and eth2 associated respectively:

In /etc/kolla/globals.yml, set

neutron_bridge_name: "br-ex,br-ex2"
neutron_external_interface: "eth1,eth2"

In /etc/kolla/config/neutron/ml2_conf.ini

[ovs]
bridge_mappings = physnet1:br-ex,physnet2:br-ex2

Co-Authored-By: Mick Thompson <michael.a.thompson@oracle.com>
Closes-Bug: #1625700
DocImpact

Change-Id: I9454ca98d9b058368129123109ccc56f95519874
---
 ansible/roles/neutron/tasks/start.yml                        | 5 ++++-
 .../notes/multiple-physical-networks-f2de7444f7e2d145.yaml   | 5 +++++
 2 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 releasenotes/notes/multiple-physical-networks-f2de7444f7e2d145.yaml

diff --git a/ansible/roles/neutron/tasks/start.yml b/ansible/roles/neutron/tasks/start.yml
index fbccfaf60a..e90d4a1763 100644
--- a/ansible/roles/neutron/tasks/start.yml
+++ b/ansible/roles/neutron/tasks/start.yml
@@ -37,7 +37,7 @@
     - neutron_plugin_agent == "openvswitch"
 
 - name: Ensuring OVS bridge is properly setup
-  command: docker exec openvswitch_db /usr/local/bin/kolla_ensure_openvswitch_configured {{ neutron_bridge_name }} {{ neutron_external_interface }}
+  command: docker exec openvswitch_db /usr/local/bin/kolla_ensure_openvswitch_configured {{ item.0 }} {{ item.1 }}
   register: status
   changed_when: status.stdout.find('changed') != -1
   when:
@@ -48,6 +48,9 @@
        or inventory_hostname in groups['neutron-metadata-agent']
        or inventory_hostname in groups['neutron-vpnaas-agent'])
     - neutron_plugin_agent == "openvswitch"
+  with_together:
+    - "{{ neutron_bridge_name.split(',') }}"
+    - "{{ neutron_external_interface.split(',') }}"
 
 - name: Starting openvswitch-vswitchd container
   kolla_docker:
diff --git a/releasenotes/notes/multiple-physical-networks-f2de7444f7e2d145.yaml b/releasenotes/notes/multiple-physical-networks-f2de7444f7e2d145.yaml
new file mode 100644
index 0000000000..b628be3920
--- /dev/null
+++ b/releasenotes/notes/multiple-physical-networks-f2de7444f7e2d145.yaml
@@ -0,0 +1,5 @@
+---
+features:
+  - Fix the implementation of Neutron physical network
+    provisioning, operators can now configure multiple
+    physical networks using augmentation files.