From 6c2b61453320d81f9b459396157aaf68f2d38462 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Tue, 21 Mar 2017 13:03:36 +0000 Subject: [PATCH] Cleanup plugin loaded_base neutron_plugin_loaded_base is only used in the template. This var probably shouldn't be used by any deployer, so we mask this variable from the defaults. Currently, we still keep this overridable behavior: neutron_plugin_loaded_base can still be overriden by a deployer, and we still rely on plugin_base if the deployer hasn't defined it. Change-Id: I8d7903dbb9a6f7d096eb3f840164b87c48eb5e4d --- defaults/main.yml | 1 - templates/neutron.conf.j2 | 13 ++++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 661362d7..3482ec8d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -138,7 +138,6 @@ neutron_lbaasv2: "{% if (neutron_lbaas_namespace|bool) or (neutron_lbaas_octavia neutron_plugin_base: - router - metering -neutron_plugin_loaded_base: "{% for plugin in neutron_plugin_base %}{{ plugin }}{% if not loop.last %},{% endif %}{% endfor %}{% if (neutron_lbaasv2|bool) and ('neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2' not in neutron_plugin_base) %},lbaasv2{% endif %}" # Neutron Plugins # The neutron core plugin (ML2) is defined with neutron_plug in_type, diff --git a/templates/neutron.conf.j2 b/templates/neutron.conf.j2 index e9cc79ed..9819e06b 100644 --- a/templates/neutron.conf.j2 +++ b/templates/neutron.conf.j2 @@ -1,4 +1,15 @@ # {{ ansible_managed }} +{% set neutron_plugin_loaded_base = [] %} + +{% for plugin in neutron_plugin_base %} + {% if plugin != 'dns' %} + {% set _ = neutron_plugin_loaded_base.append(plugin) %} + {% endif %} +{% endfor %} + +{% if (neutron_lbaasv2|bool) and ('neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2' not in neutron_plugin_base) %} + {% set _ = neutron_plugin_loaded_base.append("lbaasv2") %} +{%- endif -%} # General, applies to all host groups [DEFAULT] @@ -25,7 +36,7 @@ vlan_transparent = False # Plugins core_plugin = {{ neutron_plugin_core }} {% if neutron_plugin_type.split('.')[0] == 'ml2' %} -service_plugins = {{ neutron_plugin_loaded_base }} +service_plugins = {{ neutron_plugin_loaded_base | join(',') }} {% endif %} # MAC address generation for VIFs