Move optional plugin installs out of the venv

The optionally enabled plugins do not need to be included in the
neutron venv, but should be added to the venv when enabled.

This prevents clashes between plugins and unnecessary db
migrations, including migrations which may not be working due to
changes in neutron core which haven't been applied to the plugin
yet.

Additionally, to unblock the CentOS-7 check, this patch includes
adding a task to remove any problem packages on the target host.

Related-Bug: #1640319
Co-Authored-By: Donovan Francesco <donovan.francesco@gmail.com>
Change-Id: I7dcab3f3d56118b93b9a5d74065234acb620ae22
This commit is contained in:
Jesse Pretorius 2016-11-09 11:51:07 +00:00 committed by Jesse Pretorius (odyssey4me)
parent ecb0152f2c
commit d4dd9df137
4 changed files with 49 additions and 4 deletions

View File

@ -495,10 +495,6 @@ neutron_pip_packages:
- keystonemiddleware
- PyMySQL
- neutron
- neutron_fwaas
- neutron_lbaas
- neutron_vpnaas
- neutron_dynamic_routing
- pycrypto
- python-glanceclient
- python-keystoneclient
@ -507,11 +503,23 @@ neutron_pip_packages:
- python-novaclient
- repoze.lru
neutron_optional_bgp_pip_packages:
- neutron_dynamic_routing
neutron_optional_calico_pip_packages:
- felix
- networking-calico
- python-etcd
neutron_optional_fwaas_pip_packages:
- neutron_fwaas
neutron_optional_lbaas_pip_packages:
- neutron_lbaas
neutron_optional_vpnaas_pip_packages:
- neutron_vpnaas
neutron_proprietary_nuage_pip_packages:
- nuage-openstack-neutron
- nuage-openstack-neutronclient

View File

@ -84,3 +84,12 @@
- neutron_services['neutron-vpnaas-agent']['group'] in group_names
- neutron_vpnaas | bool
- name: Remove known problem packages
yum:
pkg: "{{ item }}"
state: absent
register: remove_packages
until: remove_packages|success
retries: 5
delay: 2
with_items: "{{ neutron_remove_distro_packages }}"

View File

@ -126,3 +126,29 @@
when:
- not neutron_developer_mode | bool
- neutron_get_venv | success
- name: Install optional pip packages
pip:
name: "{{ item.packages }}"
state: "{{ neutron_pip_package_state }}"
virtualenv: "{{ neutron_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: >-
{{ neutron_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }}
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
{{ pip_install_options | default('') }}
with_items:
- packages: "{{ neutron_optional_bgp_pip_packages }}"
enabled: "{{ neutron_bgp | bool }}"
- packages: "{{ neutron_optional_fwaas_pip_packages }}"
enabled: "{{ neutron_fwaas | bool }}"
- packages: "{{ neutron_optional_lbaas_pip_packages }}"
enabled: "{{ neutron_lbaasv2 | bool }}"
- packages: "{{ neutron_optional_vpnaas_pip_packages }}"
enabled: "{{ neutron_vpnaas | bool }}"
when: "{{ item.enabled }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
notify: Restart neutron services

View File

@ -38,5 +38,7 @@ neutron_lbaas_distro_packages:
neutron_vpnaas_distro_packages:
- openswan
neutron_remove_distro_packages: []
neutron_lbaasv2_initscript_path: "/etc/init/neutron-lbaasv2-agent.conf"
neutron_lbaasv2_agent_servicename: "neutron-lbaasv2-agent"