Make pip_install honour pip_install_options

Add a pip_install_options variable to the extra_args parameter of
the Ínstall pip packages task.

The variable is set to a default value of "" in the roles default
variables.

Change-Id: I3ffead4f63c85215c2d6b6fec5a02837cc7f7551
Closes-Bug: 1620872
This commit is contained in:
Neill Cox 2016-09-09 10:47:46 +10:00
parent 2aa35cd95d
commit 571fe1f127
2 changed files with 9 additions and 1 deletions

View File

@ -66,3 +66,11 @@ pip_links: []
## Tunable overrides
pip_global_conf_overrides: {}
## Additional options to pass to pip
# Example:
# pip_install_options: "--cert /etc/ssl/certs/ca-certificates.crt"
#
# See the documentationat https://pip.pypa.io/en/stable/reference/pip
# for details.
pip_install_options: ""

View File

@ -39,7 +39,7 @@
pip:
name: "{{ pip_required_pip_packages | map('quote') | join(' ') }}"
state: latest
extra_args: "{{ (pip_install_fall_back | changed) | ternary('--isolated', '') }}"
extra_args: "{{ (pip_install_fall_back | changed) | ternary('--isolated', '') }} {{ pip_install_options }}"
register: install_packages
until: install_packages|success
retries: 5