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:
David Moreau Simard 2019-05-21 11:02:35 -04:00
parent 0f8d206659
commit 052f28a9a2
No known key found for this signature in database
GPG Key ID: CBEB466764A9E621
6 changed files with 14 additions and 6 deletions

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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"

View File

@ -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: