Support extra ml2 plugins in neutron

Add support to use custom/extra ml2 plugins for vendor
drivers.

Change-Id: I8586c447dc3b91357b2eecb7a9c4724e033e595f
This commit is contained in:
Eduardo Gonzalez 2018-02-28 10:59:56 +01:00
parent 2d4da7093a
commit 418cb52767
5 changed files with 61 additions and 0 deletions

View File

@ -27,6 +27,12 @@
- item.value.host_in_groups | bool
with_dict: "{{ neutron_services }}"
- name: Check if extra ml2 plugins exists
local_action: find path="{{ node_custom_config }}/neutron/plugins/"
run_once: True
changed_when: False
register: check_extra_ml2_plugins
- name: Copying over config.json files for services
become: true
template:
@ -419,6 +425,30 @@
notify:
- "Restart {{ service_name }} container"
- name: Copying over extra ml2 plugins
become: true
vars:
service_name: "{{ item.0 }}"
services_need_ml2_conf_ini:
- "neutron-linuxbridge-agent"
- "neutron-openvswitch-agent"
- "neutron-server"
template:
src: "{{ item.2.path }}"
dest: "{{ node_config_directory }}/{{ service_name }}/{{ item.2.path | basename }}"
mode: "0660"
register: extra_ml2_plugins
when:
- item.2 is defined
- item.1.enabled | bool
- item.1.host_in_groups | bool
- service_name in services_need_ml2_conf_ini
with_nested:
- "{{ neutron_services | dictsort }}"
- "{{ check_extra_ml2_plugins.files }}"
notify:
- "Restart {{ item.0 }} container"
# TODO check the environment change
- name: Check neutron containers
kolla_docker:

View File

@ -13,6 +13,14 @@
"owner": "neutron",
"perm": "0600"
},
{% if check_extra_ml2_plugins is defined and check_extra_ml2_plugins.matched > 0 %}{% for plugin in check_extra_ml2_plugins.files %}
{
"source": "{{ container_config_directory }}/{{ plugin.path | basename }}",
"dest": "/etc/neutron/plugins/ml2/{{ plugin.path | basename }}",
"owner": "neutron",
"perm": "0600"
},
{% endfor %}{% endif %}
{
"source": "{{ container_config_directory }}/policy.json",
"dest": "/etc/neutron/policy.json",

View File

@ -13,6 +13,14 @@
"owner": "neutron",
"perm": "0600"
},
{% if check_extra_ml2_plugins is defined and check_extra_ml2_plugins.matched > 0 %}{% for plugin in check_extra_ml2_plugins.files %}
{
"source": "{{ container_config_directory }}/{{ plugin.path | basename }}",
"dest": "/etc/neutron/plugins/ml2/{{ plugin.path | basename }}",
"owner": "neutron",
"perm": "0600"
},
{% endfor %}{% endif %}
{
"source": "{{ container_config_directory }}/policy.json",
"dest": "/etc/neutron/policy.json",

View File

@ -31,6 +31,14 @@
"owner": "neutron",
"perm": "0600"
},
{% if check_extra_ml2_plugins is defined and check_extra_ml2_plugins.matched > 0 %}{% for plugin in check_extra_ml2_plugins.files %}
{
"source": "{{ container_config_directory }}/{{ plugin.path | basename }}",
"dest": "/etc/neutron/plugins/ml2/{{ plugin.path | basename }}",
"owner": "neutron",
"perm": "0600"
},
{% endfor %}{% endif %}
{
"source": "{{ container_config_directory }}/policy.json",
"dest": "/etc/neutron/policy.json",

View File

@ -0,0 +1,7 @@
---
features:
- |
Introduces support to use extra ml2 plugins non maintained
by kolla-ansible, an operator may add a file
``/etc/kolla/config/neutron/plugins/awesome_plugin.ini`` and
will be copied into ml2 plugins folder during runtime.