Skip to content

Commit a322440

Browse files
committed
feat(venvs): split python 2.7 venv creation
Install `virtualenv` with `pip` to ensure it works.
1 parent 2936bb3 commit a322440

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

tasks/venv27.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
3+
- name: "Virtualenv | Check if it is already installed | {{ py_data.version }}"
4+
become: true
5+
ansible.builtin.stat:
6+
path: "{{ py_data.install }}/bin/virtualenv"
7+
register: already_installed
8+
ignore_errors: true
9+
10+
- name: "Virtualenv | Download | {{ py_data.version }}"
11+
ansible.builtin.get_url:
12+
url: "{{ venv_data.url }}"
13+
dest: "{{ venv_data.wheel_file }}"
14+
checksum: "md5:{{ venv_data.md5 }}"
15+
mode: "0440"
16+
when: not already_installed.stat.exists
17+
18+
- name: "Virtualenv | Download | pip"
19+
ansible.builtin.get_url:
20+
url: "https://bootstrap.pypa.io/pip/2.7/get-pip.py"
21+
dest: "/tmp/get-pip.py"
22+
checksum: "md5:60e8267eb1b7bc71dc4843eb7bd294d3"
23+
mode: "0440"
24+
when: not already_installed.stat.exists
25+
26+
- name: "Virtualenv | Install | pip"
27+
ansible.builtin.command: "{{ item }}"
28+
args:
29+
creates: "{{ py_data.install }}/bin/pip"
30+
with_items:
31+
- "{{ py_data.install }}/bin/python /tmp/get-pip.py"
32+
when: not already_installed.stat.exists
33+
34+
- name: " Virtualenv | Install | {{ py_data.version }}"
35+
become: true
36+
ansible.builtin.command: "{{ item }}"
37+
args:
38+
creates: "{{ py_data.install }}/bin/virtualenv"
39+
with_items:
40+
- "{{ py_data.install }}/bin/pip install {{ venv_data.wheel_file }}"
41+
when: not already_installed.stat.exists

tasks/venvs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
- name: Install Virtualenv for Python 2.7
2020
ansible.builtin.include_tasks:
21-
file: venv.yml
21+
file: venv27.yml
2222
vars:
2323
py_data: "{{ py27 }}"
2424
venv_data: "{{ venv27 }}"

0 commit comments

Comments
 (0)