@ -1,20 +1,30 @@
# Current pip unconditionally uses md5.
# Current pip unconditionally uses md5.
# We can re-enable if pip switches to a different hash or allows us to not check md5.
# We can re-enable if pip switches to a different hash or allows us to not check md5.
- name : find virtualenv command
- name : Python 2
command : "which virtualenv virtualenv-{{ ansible_python.version.major }}.{{ ansible_python.version.minor }}"
when : ansible_python.version.major == 2
register : command
block:
ignore_errors : true
- name : find virtualenv command
command : "which virtualenv virtualenv-{{ ansible_python.version.major }}.{{ ansible_python.version.minor }}"
register : command
ignore_errors : true
- name : is virtualenv available to python -m
- name : is virtualenv available to python -m
command : '{{ ansible_python_interpreter }} -m virtualenv'
command : '{{ ansible_python_interpreter }} -m virtualenv'
register : python_m
register : python_m
when : not command.stdout_lines
when : not command.stdout_lines
failed_when : python_m.rc != 2
failed_when : python_m.rc != 2
- name : remember selected virtualenv command
- name : remember selected virtualenv command
set_fact:
set_fact:
virtualenv : "{{ command.stdout_lines[0] if command is successful else ansible_python_interpreter ~ ' -m virtualenv' }}"
virtualenv : "{{ command.stdout_lines[0] if command is successful else ansible_python_interpreter ~ ' -m virtualenv' }}"
- name : Python 3+
when : ansible_python.version.major > 2
block:
- name : remember selected virtualenv command
set_fact:
virtualenv : "{{ ansible_python_interpreter ~ ' -m venv' }}"
- block:
- block:
- name : install git, needed for repo installs
- name : install git, needed for repo installs