From 6e12517164ec98a0876c83129d5866e1737d4b2c Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 27 Mar 2019 13:56:28 -0700 Subject: [PATCH] Make pip test work with versioned virtualenv. (#54483) --- test/integration/targets/pip/tasks/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/integration/targets/pip/tasks/main.yml b/test/integration/targets/pip/tasks/main.yml index fec7c2af518..d81d103559b 100644 --- a/test/integration/targets/pip/tasks/main.yml +++ b/test/integration/targets/pip/tasks/main.yml @@ -1,5 +1,17 @@ # Current pip unconditionally uses md5. # We can re-enable if pip switches to a different hash or allows us to not check md5. +- name: find virtualenv command + command: "which virtualenv virtualenv-{{ ansible_python.version.major }}.{{ ansible_python.version.minor }}" + register: command + failed_when: not command.stdout_lines + +- name: remember selected virtualenv command + set_fact: + virtualenv: "{{ command.stdout_lines[0] }}" + - include: 'pip.yml' when: ansible_fips|bool != True + module_defaults: + pip: + virtualenv_command: "{{ virtualenv }}"