From 17165c4da790b8c3bfb7011519ad970ced02b41e Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Fri, 19 May 2017 14:17:59 +0100
Subject: [PATCH] Allow configuration of neutron extension drivers

---
 ansible/group_vars/all/neutron                          | 6 ++++++
 ansible/roles/kolla-openstack/defaults/main.yml         | 3 +++
 ansible/roles/kolla-openstack/templates/ml2_conf.ini.j2 | 4 ++++
 etc/kayobe/neutron.yml                                  | 3 +++
 4 files changed, 16 insertions(+)

diff --git a/ansible/group_vars/all/neutron b/ansible/group_vars/all/neutron
index 4bf60fb4..7a987c8d 100644
--- a/ansible/group_vars/all/neutron
+++ b/ansible/group_vars/all/neutron
@@ -25,6 +25,12 @@ kolla_neutron_ml2_tenant_network_types:
 # range: Range of allowed VLANs on this physical network (min:max, (optional)
 kolla_neutron_ml2_network_vlan_ranges: []
 
+# List of Neutron ML2 extention drivers to use.
+kolla_neutron_ml2_extension_drivers: []
+
+###############################################################################
+# Neutron ML2 generic switch driver configuration.
+
 # List of switches to configure for use by genericswitch ML2 mechanism driver.
 # Each item should be a dict containing the following items:
 # name: Hostname of the switch
diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml
index dcee74ce..c298850a 100644
--- a/ansible/roles/kolla-openstack/defaults/main.yml
+++ b/ansible/roles/kolla-openstack/defaults/main.yml
@@ -189,6 +189,9 @@ kolla_neutron_ml2_tenant_network_types: []
 # range: Range of allowed VLANs on this physical network (min:max, (optional)
 kolla_neutron_ml2_network_vlan_ranges: []
 
+# List of Neutron ML2 extention drivers to use.
+kolla_neutron_ml2_extension_drivers: []
+
 # List of switches to configure for use by genericswitch ML2 mechanism driver.
 # Each item should be a dict containing the following items;
 # name: Hostname of the switch
diff --git a/ansible/roles/kolla-openstack/templates/ml2_conf.ini.j2 b/ansible/roles/kolla-openstack/templates/ml2_conf.ini.j2
index c4a01b1f..e26c1547 100644
--- a/ansible/roles/kolla-openstack/templates/ml2_conf.ini.j2
+++ b/ansible/roles/kolla-openstack/templates/ml2_conf.ini.j2
@@ -13,6 +13,10 @@ type_drivers = {{ kolla_neutron_ml2_type_drivers | join(',') }}
 tenant_network_types = {{ kolla_neutron_ml2_tenant_network_types | join(',') }}
 {% endif %}
 
+{% if kolla_neutron_ml2_extension_drivers %}
+extension_drivers = {{ kolla_neutron_ml2_extension_drivers | join(',') }}
+{% endif %}
+
 [ml2_type_vlan]
 {% if kolla_neutron_ml2_network_vlan_ranges %}
 network_vlan_ranges = {% for vnr in kolla_neutron_ml2_network_vlan_ranges %}{{ vnr.physical_network }}{% if vnr.range is defined %}:{{ vnr.range }}{% endif %}{% if not loop.last %},{% endif %}{% endfor %}
diff --git a/etc/kayobe/neutron.yml b/etc/kayobe/neutron.yml
index 39073f02..b425d245 100644
--- a/etc/kayobe/neutron.yml
+++ b/etc/kayobe/neutron.yml
@@ -18,6 +18,9 @@
 # max: Maximum of allowed VLAN range (optional)
 #kolla_neutron_ml2_network_vlan_ranges:
 
+# List of Neutron ML2 extention drivers to use.
+#kolla_neutron_ml2_extension_drivers:
+
 # List of switches to configure for use by genericswitch ML2 mechanism driver.
 # Each item should be a dict containing the following items:
 # name: Hostname of the switch
-- 
GitLab