diff --git a/tasks/python_venv_build.yml b/tasks/python_venv_build.yml index d80d9d4..fe38dfe 100644 --- a/tasks/python_venv_build.yml +++ b/tasks/python_venv_build.yml @@ -48,8 +48,7 @@ - name: Create the virtualenv (if it does not exist) command: >- virtualenv - --no-site-packages - {{ _venv_create_no_download }} + {{ _venv_create_extra_options }} --python={{ venv_python_executable }} {{ (ansible_pkg_mgr == 'apt') | ternary('--always-copy', '') }} {{ venv_install_destination_path }} diff --git a/tasks/python_venv_preflight.yml b/tasks/python_venv_preflight.yml index af5fdf2..5ebc52e 100644 --- a/tasks/python_venv_preflight.yml +++ b/tasks/python_venv_preflight.yml @@ -40,10 +40,11 @@ - ((_virtualenv_version.stdout | trim) == 'none') or ((_virtualenv_version.stdout | trim) is version_compare('1.10', '<')) -- name: Set the correct virtualenv parameter to prevent downloads when creating +- name: Set extra virtualenv parameters set_fact: - _venv_create_no_download: >- + _venv_create_extra_options: >- {{ ((_virtualenv_version.stdout | trim) is version_compare('14.0.0', '<')) | ternary('--never-download', '--no-download') }} + {{ ((_virtualenv_version.stdout | trim) is version_compare('1.7.0', '<')) | ternary('--no-site-packages', '') }} - name: Check whether the venv_install_source_path is a URL or a file path set_fact: