From 571fe1f12725260e86ed8e40eb6a3e0f527218fc Mon Sep 17 00:00:00 2001 From: Neill Cox Date: Fri, 9 Sep 2016 10:47:46 +1000 Subject: [PATCH] Make pip_install honour pip_install_options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- defaults/main.yml | 8 ++++++++ tasks/install_source.yml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 795e28d..8a23def 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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: "" diff --git a/tasks/install_source.yml b/tasks/install_source.yml index ace47d4..88f3def 100644 --- a/tasks/install_source.yml +++ b/tasks/install_source.yml @@ -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