You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/tests/ansible/regression/issue_152__virtualenv_pytho...

45 lines
1.4 KiB
YAML

- name: regression/issue_152__virtualenv_python_fails.yml
any_errors_fatal: true
gather_facts: true
hosts: test-targets
tasks:
- custom_python_detect_environment:
register: lout
# 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'
environment:
https_proxy: "{{ lookup('env', 'https_proxy')|default('') }}"
no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}"
PATH: "{{ lookup('env', 'PATH') }}"
- name: set python interpreter because mac symlinks things and complains
block:
- name: set python3 interpreter
when: lout.python_version.startswith('3')
set_fact:
python_interpreter: /tmp/issue_152_virtualenv/bin/python3
- name: set python2 interpreter
when: lout.python_version.startswith('2')
set_fact:
python_interpreter: /tmp/issue_152_virtualenv/bin/python
- custom_python_detect_environment:
vars:
ansible_python_interpreter: "{{ python_interpreter }}"
register: out
when: lout.python_version > '2.6'
- assert:
that:
- out.sys_executable == "{{ python_interpreter }}"
when: lout.python_version > '2.6'
- file:
path: /tmp/issue_152_virtualenv
state: absent
when: lout.python_version > '2.6'