Dynamically determine whether Neutron Agents should be enabled

Both the Nuage and PLUMgrid configuration guides advocate overwriting
the entire neutron_services dict in order to disable the DHCP,
Metadata and LinuxBridge Agents. This method is prone to error and
should ideally be more dynamic.

This patch implements a more dynamic approach based on the
neutron_plugin_type and the neutron_ml2_mechanism_drivers that are
set.

This will hopefully simplify the configuration of these and other
ML2 mechanisms (eg: openvswitch) when they're implemented.

Change-Id: I38e1fad4dfae24b32f4370b3da16561c42cd670d
This commit is contained in:
Jesse Pretorius 2016-04-20 09:53:36 +01:00
parent ea3dd6f393
commit 56cff84860
2 changed files with 32 additions and 8 deletions

View File

@ -130,7 +130,7 @@ neutron_services:
neutron-dhcp-agent: neutron-dhcp-agent:
group: neutron_dhcp_agent group: neutron_dhcp_agent
service_name: neutron-dhcp-agent service_name: neutron-dhcp-agent
service_en: True service_en: "{{ neutron_dhcp | bool }}"
service_conf: dhcp_agent.ini service_conf: dhcp_agent.ini
service_group: neutron_agent service_group: neutron_agent
service_rootwrap: rootwrap.d/dhcp.filters service_rootwrap: rootwrap.d/dhcp.filters
@ -140,7 +140,7 @@ neutron_services:
neutron-linuxbridge-agent: neutron-linuxbridge-agent:
group: neutron_linuxbridge_agent group: neutron_linuxbridge_agent
service_name: neutron-linuxbridge-agent service_name: neutron-linuxbridge-agent
service_en: True service_en: "{{ neutron_linuxbridge | bool }}"
service_conf: plugins/ml2/linuxbridge_agent.ini service_conf: plugins/ml2/linuxbridge_agent.ini
service_group: neutron_linuxbridge_agent service_group: neutron_linuxbridge_agent
service_rootwrap: rootwrap.d/linuxbridge-plugin.filters service_rootwrap: rootwrap.d/linuxbridge-plugin.filters
@ -150,7 +150,7 @@ neutron_services:
neutron-metadata-agent: neutron-metadata-agent:
group: neutron_metadata_agent group: neutron_metadata_agent
service_name: neutron-metadata-agent service_name: neutron-metadata-agent
service_en: True service_en: "{{ neutron_metadata | bool }}"
service_conf: metadata_agent.ini service_conf: metadata_agent.ini
service_group: neutron_agent service_group: neutron_agent
config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini
@ -159,7 +159,7 @@ neutron_services:
neutron-metering-agent: neutron-metering-agent:
group: neutron_metering_agent group: neutron_metering_agent
service_name: neutron-metering-agent service_name: neutron-metering-agent
service_en: "{{ neutron_metering }}" service_en: "{{ neutron_metering | bool }}"
service_conf: metering_agent.ini service_conf: metering_agent.ini
service_group: neutron_agent service_group: neutron_agent
config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metering_agent.ini config_options: --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metering_agent.ini
@ -168,7 +168,7 @@ neutron_services:
neutron-l3-agent: neutron-l3-agent:
group: neutron_l3_agent group: neutron_l3_agent
service_name: neutron-l3-agent service_name: neutron-l3-agent
service_en: "{{ neutron_l3 }}" service_en: "{{ neutron_l3 | bool }}"
service_conf: l3_agent.ini service_conf: l3_agent.ini
service_group: neutron_agent service_group: neutron_agent
service_rootwrap: rootwrap.d/l3.filters service_rootwrap: rootwrap.d/l3.filters
@ -178,7 +178,7 @@ neutron_services:
neutron-lbaas-agent: neutron-lbaas-agent:
group: neutron_lbaas_agent group: neutron_lbaas_agent
service_name: neutron-lbaas-agent service_name: neutron-lbaas-agent
service_en: "{{ neutron_lbaas }}" service_en: "{{ neutron_lbaas | bool }}"
service_conf: lbaas_agent.ini service_conf: lbaas_agent.ini
service_group: neutron_agent service_group: neutron_agent
service_rootwrap: rootwrap.d/lbaas-haproxy.filters service_rootwrap: rootwrap.d/lbaas-haproxy.filters
@ -188,7 +188,7 @@ neutron_services:
neutron-lbaasv2-agent: neutron-lbaasv2-agent:
group: neutron_lbaas_agent group: neutron_lbaas_agent
service_name: neutron-lbaasv2-agent service_name: neutron-lbaasv2-agent
service_en: "{{ neutron_lbaasv2 }}" service_en: "{{ neutron_lbaasv2 | bool }}"
service_conf: lbaas_agent.ini service_conf: lbaas_agent.ini
service_group: neutron_agent service_group: neutron_agent
service_rootwrap: rootwrap.d/lbaas-haproxy.filters service_rootwrap: rootwrap.d/lbaas-haproxy.filters
@ -198,7 +198,7 @@ neutron_services:
neutron-vpnaas-agent: neutron-vpnaas-agent:
group: neutron_l3_agent group: neutron_l3_agent
service_name: neutron-vpnaas-agent service_name: neutron-vpnaas-agent
service_en: "{{ neutron_vpnaas }}" service_en: "{{ neutron_vpnaas | bool }}"
service_conf: vpnaas_agent.ini service_conf: vpnaas_agent.ini
service_group: neutron_agent service_group: neutron_agent
service_rootwrap: rootwrap.d/vpnaas.filters service_rootwrap: rootwrap.d/vpnaas.filters
@ -212,6 +212,15 @@ neutron_services:
service_group: neutron_server service_group: neutron_server
config_options: "--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/{{ neutron_plugins[neutron_plugin_type].plugin_ini }}" config_options: "--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/{{ neutron_plugins[neutron_plugin_type].plugin_ini }}"
## Neutron DHCP Agent
neutron_dhcp: "{% if neutron_plugin_type == 'ml2' %}True{% else %}False{% endif %}"
## Neutron Metadata Agent
neutron_metadata: "{% if neutron_plugin_type == 'ml2' %}True{% else %}False{% endif %}"
## Neutron LinuxBridge Agent
neutron_linuxbridge: "{% if neutron_plugin_type == 'ml2' and 'linuxbridge' in neutron_ml2_mechanism_drivers %}True{% else %}False{% endif %}"
## Neutron LBaaS ## Neutron LBaaS
# See documentation section titled "Configuring the Network Load Balacing # See documentation section titled "Configuring the Network Load Balacing
# Service (Optional)" for more details. # Service (Optional)" for more details.

View File

@ -0,0 +1,15 @@
---
features:
- Whether the Neutron DHCP Agent, Metadata Agent or LinuxBridge Agent
should be enabled is now dynamically determined based on the
``neutron_plugin_type`` and the ``neutron_ml2_mechanism_drivers``
that are set. This aims to simplify the configuration of Neutron
services and eliminate the need for deployers to override the
entire ``neutron_services`` dict variable to disable these services.
upgrade:
- Whether the Neutron DHCP Agent, Metadata Agent or LinuxBridge Agent
should be enabled is now dynamically determined based on the
``neutron_plugin_type`` and the ``neutron_ml2_mechanism_drivers``
that are set. This aims to simplify the configuration of Neutron
services and eliminate the need for deployers to override the
entire ``neutron_services`` dict variable to disable these services.