From 053fb379ec1d0a63f8767b67917f31c9dd4c3d77 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Date: Mon, 30 Jan 2017 11:10:15 +0000 Subject: [PATCH] Make service_plugins and extensions more configurable Ease new service_plugins and extension integration as well as improve code readiness. Change-Id: I9924de51a70e9342c9ac56113c9fbd148a58c322 --- ansible/roles/neutron/defaults/main.yml | 21 +++++++++++++++++++ .../roles/neutron/templates/neutron.conf.j2 | 3 ++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ansible/roles/neutron/defaults/main.yml b/ansible/roles/neutron/defaults/main.yml index 9a6a93fc77..6c247bf727 100644 --- a/ansible/roles/neutron/defaults/main.yml +++ b/ansible/roles/neutron/defaults/main.yml @@ -299,3 +299,24 @@ extension_drivers: enabled: "{{ enable_designate | bool }}" neutron_extension_drivers: "{{ extension_drivers|selectattr('enabled', 'equalto', true)|list }}" + +#################### +# Service Plugins +#################### +service_plugins: + - name: "flow_classifier" + enabled: "{{ neutron_plugin_agent == 'sfc' }}" + - name: "neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2" + enabled: "{{ enable_neutron_lbaas | bool }}" + - name: "neutron.services.firewall.fwaas_plugin.FirewallPlugin" + enabled: "{{ enable_neutron_fwaas | bool }}" + - name: "neutron_vpnaas.services.vpn.plugin.VPNDriverPlugin" + enabled: "{{ enable_neutron_vpnaas | bool }}" + - name: "qos" + enabled: "{{ enable_neutron_qos | bool }}" + - name: "router" + enabled: true + - name: "sfc" + enabled: "{{ neutron_plugin_agent == 'sfc' }}" + +neutron_service_plugins: "{{ service_plugins|selectattr('enabled', 'equalto', true)|list }}" diff --git a/ansible/roles/neutron/templates/neutron.conf.j2 b/ansible/roles/neutron/templates/neutron.conf.j2 index 57399ebec3..eed201f6d2 100644 --- a/ansible/roles/neutron/templates/neutron.conf.j2 +++ b/ansible/roles/neutron/templates/neutron.conf.j2 @@ -35,7 +35,8 @@ host = {{ ansible_hostname }}_{{ item }} allow_overlapping_ips = true core_plugin = ml2 -service_plugins = router{% if enable_neutron_lbaas | bool %},neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2{% endif %}{% if enable_neutron_qos | bool %},qos{% endif %}{% if enable_neutron_vpnaas | bool %},neutron_vpnaas.services.vpn.plugin.VPNDriverPlugin{% endif %}{% if neutron_plugin_agent == "sfc" %}flow_classifier,sfc{% endif %}{% if enable_neutron_fwaas | bool %},neutron.services.firewall.fwaas_plugin.FirewallPlugin{% endif %} + +service_plugins = {{ neutron_service_plugins|map(attribute='name')|join(',') }} {% if enable_neutron_agent_ha | bool %} dhcp_agents_per_network = {{ dhcp_agents_per_network }}