From 1706e17ae921ec436410b9824433c1805506a1a1 Mon Sep 17 00:00:00 2001
From: liyingjun <yingjun.li@kylin-cloud.com>
Date: Wed, 28 Sep 2016 14:35:24 +0800
Subject: [PATCH] Fix template for multiple physical networks

This patch [1] adds support to config multiple physical networks for
ovs neutron plugin, but it missed to change ml2_conf.ini.j2
correspondingly.

[1]: https://review.openstack.org/#/c/373455/

Change-Id: I1937e1e5986657470add07d4bcf8587642aa45ec
Closes-bug: #1631903
---
 ansible/roles/neutron/templates/ml2_conf.ini.j2 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ansible/roles/neutron/templates/ml2_conf.ini.j2 b/ansible/roles/neutron/templates/ml2_conf.ini.j2
index 27e98137f..f304d023e 100644
--- a/ansible/roles/neutron/templates/ml2_conf.ini.j2
+++ b/ansible/roles/neutron/templates/ml2_conf.ini.j2
@@ -30,7 +30,7 @@ network_vlan_ranges =
 {% if enable_ironic | bool %}
 flat_networks = *
 {% else %}
-flat_networks = physnet1
+flat_networks = {% for bridge in neutron_bridge_name.split(',') %}physnet{{ loop.index0 + 1 }}{% if not loop.last %},{% endif %}{% endfor %}
 {% endif %}
 
 [ml2_type_vxlan]
@@ -55,7 +55,8 @@ enable_distributed_routing = True
 {% endif %}
 
 [ovs]
-bridge_mappings = physnet1:{{ neutron_bridge_name }}
+bridge_mappings = {% for bridge in neutron_bridge_name.split(',') %}physnet{{ loop.index0 + 1 }}:{{ bridge }}{% if not loop.last %},{% endif %}{% endfor %}
+
 ovsdb_connection = tcp:{{ api_interface_address }}:6640
 {% if enable_nova_fake | bool %}
 integration_bridge = br-int-{{ item }}
-- 
GitLab