mitogen/tests/ansible/regression/issue_152__virtualenv_pytho...

40 lines
1.4 KiB
YAML
Raw Normal View History

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