roles: use virtualenv_command instead of virtualenv_python
python3 -m venv is always expected to work while virtualenv_python might attempt to use a virtualenv binary script. We already make sure that python3-venv is installed in the ara_api pre-requirements. Fixes: https://github.com/ansible-community/ara/issues/43 Change-Id: I0994cd99e24f9a23d0dfeb66e8b838ced7aed948
This commit is contained in:
parent
0f8d206659
commit
052f28a9a2
@ -19,6 +19,7 @@
|
||||
ara_tests_cleanup: false
|
||||
integration_ansible_name: "{{ ansible_user_dir }}/src/github.com/ansible/ansible"
|
||||
integration_ansible_version: null
|
||||
pre-run: tests/role-integration-pre.yaml
|
||||
run: playbooks/ara_tests.yaml
|
||||
post-run: tests/ara_tests_post.yaml
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
name: psycopg2
|
||||
state: present
|
||||
virtualenv: "{{ ara_api_venv | bool | ternary(ara_api_venv_path, omit) }}"
|
||||
virtualenv_python: python3
|
||||
virtualenv_command: /usr/bin/python3 -m venv
|
||||
|
||||
- name: Run SQL migrations
|
||||
environment:
|
||||
|
@ -27,7 +27,7 @@
|
||||
name: "{{ ara_api_source_checkout }}[server]"
|
||||
state: present
|
||||
virtualenv: "{{ ara_api_venv | bool | ternary(ara_api_venv_path, omit) }}"
|
||||
virtualenv_python: python3
|
||||
virtualenv_command: /usr/bin/python3 -m venv
|
||||
|
||||
- name: Prefix the virtualenv bin directory to PATH
|
||||
set_fact:
|
||||
|
@ -21,7 +21,7 @@
|
||||
name: gunicorn
|
||||
state: present
|
||||
virtualenv: "{{ ara_api_venv | bool | ternary(ara_api_venv_path, omit) }}"
|
||||
virtualenv_python: python3
|
||||
virtualenv_command: /usr/bin/python3 -m venv
|
||||
|
||||
- become: yes
|
||||
block:
|
||||
|
@ -31,6 +31,13 @@
|
||||
_ara_tests_repository: "{{ lookup('pipe', 'git rev-parse --show-toplevel') }}"
|
||||
when: zuul is not defined
|
||||
|
||||
- name: Ensure python3-venv is installed for Ubuntu
|
||||
become: yes
|
||||
package:
|
||||
name: python3-venv
|
||||
state: present
|
||||
when: ansible_distribution == "Ubuntu"
|
||||
|
||||
# If a version is not explicitly set we want to make sure to
|
||||
# completely omit the version argument to pip, as it will be coming
|
||||
# from the long-form integration_ansible_name variable. Additionally, if
|
||||
@ -52,14 +59,14 @@
|
||||
version: "{{ _install_ansible_version | default(omit, True) }}"
|
||||
state: "{{ _install_ansible_state | default(omit, True) }}"
|
||||
virtualenv: "{{ ara_tests_virtualenv }}"
|
||||
virtualenv_python: python3
|
||||
virtualenv_command: /usr/bin/python3 -m venv
|
||||
|
||||
- name: Install ARA from source in virtual environment
|
||||
pip:
|
||||
name: "{{ _ara_tests_repository }}[server]"
|
||||
state: present
|
||||
virtualenv: "{{ ara_tests_virtualenv }}"
|
||||
virtualenv_python: python3
|
||||
virtualenv_command: /usr/bin/python3 -m venv
|
||||
|
||||
- name: Get ARA plugins directory
|
||||
command: "{{ ara_tests_virtualenv }}/bin/python -m ara.setup.plugins"
|
||||
|
@ -45,7 +45,7 @@
|
||||
version: "{{ _install_ansible_version | default(omit, True) }}"
|
||||
state: "{{ _install_ansible_state | default(omit, True) }}"
|
||||
virtualenv: "{{ ara_api_venv | bool | ternary(ara_api_venv_path, omit) }}"
|
||||
virtualenv_python: python3
|
||||
virtualenv_command: /usr/bin/python3 -m venv
|
||||
|
||||
- name: Get ARA plugins directory
|
||||
environment:
|
||||
|
Loading…
Reference in New Issue
Block a user