2018-04-18 14:20:44 +00:00
|
|
|
- name: regression/issue_152__virtualenv_python_fails.yml
|
|
|
|
any_errors_fatal: true
|
2020-02-15 00:38:13 +00:00
|
|
|
gather_facts: true
|
2018-04-22 18:40:58 +00:00
|
|
|
hosts: test-targets
|
2018-03-18 14:50:38 +00:00
|
|
|
tasks:
|
2018-06-24 21:43:11 +00:00
|
|
|
- custom_python_detect_environment:
|
|
|
|
register: lout
|
2018-03-18 14:50:38 +00:00
|
|
|
|
2018-06-24 21:43:11 +00:00
|
|
|
# Can't use pip module because it can't create virtualenvs, must call it
|
|
|
|
# directly.
|
2018-04-18 14:20:44 +00:00
|
|
|
- shell: virtualenv /tmp/issue_152_virtualenv
|
2020-02-25 00:24:50 +00:00
|
|
|
when: lout.python_version > '2.6'
|
2020-02-24 23:43:45 +00:00
|
|
|
environment:
|
|
|
|
https_proxy: "{{ lookup('env', 'https_proxy')|default('') }}"
|
|
|
|
no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}"
|
|
|
|
PATH: "{{ lookup('env', 'PATH') }}"
|
|
|
|
|
2018-04-18 14:20:44 +00:00
|
|
|
- custom_python_detect_environment:
|
|
|
|
vars:
|
2020-02-25 20:57:01 +00:00
|
|
|
ansible_python_interpreter: /tmp/issue_152_virtualenv/bin/python
|
2018-04-18 14:20:44 +00:00
|
|
|
register: out
|
2019-01-27 04:44:24 +00:00
|
|
|
when: lout.python_version > '2.6'
|
2018-03-18 14:50:38 +00:00
|
|
|
|
2018-04-18 14:20:44 +00:00
|
|
|
- assert:
|
|
|
|
that:
|
2020-02-25 21:05:37 +00:00
|
|
|
- out.sys_executable == "/tmp/issue_152_virtualenv/bin/python"
|
2020-02-21 20:46:49 +00:00
|
|
|
when: lout.python_version > '2.6'
|
2018-04-18 14:20:44 +00:00
|
|
|
|
|
|
|
- file:
|
|
|
|
path: /tmp/issue_152_virtualenv
|
|
|
|
state: absent
|
2019-01-27 04:44:24 +00:00
|
|
|
when: lout.python_version > '2.6'
|