try fixing mac python symlink weirdness

pull/658/head
Steven Robertson 5 years ago
parent 0a34d378c9
commit 1157ff6f43

@ -9,28 +9,33 @@
# Can't use pip module because it can't create virtualenvs, must call it # Can't use pip module because it can't create virtualenvs, must call it
# directly. # directly.
- shell: virtualenv /tmp/issue_152_virtualenv - shell: virtualenv /tmp/issue_152_virtualenv
when: lout.python_version > '2.6' and not lout.python_version.startswith('3') when: lout.python_version > '2.6'
environment: environment:
https_proxy: "{{ lookup('env', 'https_proxy')|default('') }}" https_proxy: "{{ lookup('env', 'https_proxy')|default('') }}"
no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}" no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}"
PATH: "{{ lookup('env', 'PATH') }}" PATH: "{{ lookup('env', 'PATH') }}"
- shell: python3 -m venv /tmp/issue_152_virtualenv - name: set python interpreter because mac symlinks things and complains
when: lout.python_version > '2.6' and lout.python_version.startswith('3') block:
environment: - name: set python3 interpreter
https_proxy: "{{ lookup('env', 'https_proxy')|default('') }}" when: lout.python_version.startswith('3')
no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}" set_fact:
PATH: "{{ lookup('env', 'PATH') }}" 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: - custom_python_detect_environment:
vars: vars:
ansible_python_interpreter: /tmp/issue_152_virtualenv/bin/python ansible_python_interpreter: "{{ python_interpreter }}"
register: out register: out
when: lout.python_version > '2.6' when: lout.python_version > '2.6'
- assert: - assert:
that: that:
- out.sys_executable == "/tmp/issue_152_virtualenv/bin/python" - out.sys_executable == "{{ python_interpreter }}"
when: lout.python_version > '2.6' when: lout.python_version > '2.6'
- file: - file:

Loading…
Cancel
Save