Add option for default pip package install
Add an option to define a default set of python packages to install within a virtual environment. This can be used to install a package wihin a virtual environment that may be outside of a normal package list but for a given service. Change-Id: Ic2dc024049062ad9be396a1f71435f661576e91b Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
381f3ffba2
commit
5818696cf6
|
@ -43,6 +43,10 @@ venv_pip_package_state: "latest"
|
||||||
# package manager.
|
# package manager.
|
||||||
venv_distro_cache_valid_time: 600
|
venv_distro_cache_valid_time: 600
|
||||||
|
|
||||||
|
# Default python packages which will be installed
|
||||||
|
# into every venv.
|
||||||
|
venv_default_pip_packages: []
|
||||||
|
|
||||||
# Python packages which must be installed
|
# Python packages which must be installed
|
||||||
# into the venv.
|
# into the venv.
|
||||||
venv_pip_packages: []
|
venv_pip_packages: []
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
|
|
||||||
- name: Install python packages into the venv
|
- name: Install python packages into the venv
|
||||||
pip:
|
pip:
|
||||||
name: "{{ venv_pip_packages }}"
|
name: "{{ venv_default_pip_packages + venv_pip_packages }}"
|
||||||
state: "{{ venv_pip_package_state }}"
|
state: "{{ venv_pip_package_state }}"
|
||||||
virtualenv: "{{ venv_install_destination_path }}"
|
virtualenv: "{{ venv_install_destination_path }}"
|
||||||
extra_args: >-
|
extra_args: >-
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
--find-links {{ venv_build_host_wheel_path }}/
|
--find-links {{ venv_build_host_wheel_path }}/
|
||||||
--log /var/log/python_wheel_build.log
|
--log /var/log/python_wheel_build.log
|
||||||
{{ venv_pip_install_args }}
|
{{ venv_pip_install_args }}
|
||||||
{{ venv_pip_packages | join(' ') }}
|
{{ (venv_default_pip_packages + venv_pip_packages) | join(' ') }}
|
||||||
register: _build_python_wheels
|
register: _build_python_wheels
|
||||||
until: _build_python_wheels is success
|
until: _build_python_wheels is success
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
|
@ -138,6 +138,8 @@
|
||||||
remote_user: root
|
remote_user: root
|
||||||
any_errors_fatal: yes
|
any_errors_fatal: yes
|
||||||
vars:
|
vars:
|
||||||
|
venv_default_pip_packages:
|
||||||
|
- "elasticsearch>=6.0.0,<7.0.0"
|
||||||
venv_pip_packages:
|
venv_pip_packages:
|
||||||
- "Jinja2==2.10"
|
- "Jinja2==2.10"
|
||||||
venv_install_destination_path: "/openstack/venvs/test-venv"
|
venv_install_destination_path: "/openstack/venvs/test-venv"
|
||||||
|
|
Loading…
Reference in New Issue