Browse code

[stable-2.7] Use virtualenv in pip test to remove distribute. (cherry picked from commit 6f29eafef4d8fc49645d2382c444e9416f8ab38d)

Co-authored-by: Matt Clay <matt@mystile.com>

Matt Clay authored on 2018/11/27 09:25:50
Showing 1 changed files
... ...
@@ -501,10 +501,22 @@
501 501
     state: absent
502 502
 
503 503
 # https://github.com/ansible/ansible/issues/47198
504
+- name: make sure the virtualenv does not exist
505
+  file:
506
+    state: absent
507
+    name: "{{ output_dir }}/pipenv"
508
+
509
+- name: install distribute in the virtualenv
510
+  pip:
511
+    name: distribute
512
+    virtualenv: "{{ output_dir }}/pipenv"
513
+    state: present
514
+
504 515
 - name: try to remove distribute
505 516
   pip:
506 517
     state: "absent"
507 518
     name: "distribute"
519
+    virtualenv: "{{ output_dir }}/pipenv"
508 520
   ignore_errors: yes
509 521
   register: remove_distribute
510 522