tripleo-quickstart-extras/roles/validate-tempest/tasks/tempest-venv.yml
Sorin Sbarnea 04585eb6f4 Use dnf and python3 on platforms where these are default
Roles do not need to make any assumptions about having some facts
already gathered, thus at start they should assure they gather any
missiong facts that are used inside the role.

Change-Id: I49fd1a0c070d96aecb880164acde490c9e7c95ef
Story: https://tree.taiga.io/project/tripleo-ci-board/task/153
Depends-On: https://review.openstack.org/#/c/615489/
2018-11-05 15:58:33 +00:00

55 lines
1.6 KiB
YAML

---
- name: Cloning tempest from redhat-openstack repository
git:
repo: 'https://github.com/redhat-openstack/tempest.git'
dest: '{{ working_dir }}/tempest_git'
version: '{{ tempest_version }}'
when: release == 'newton'
- name: Cloning tempest from openstack repository
git:
repo: 'https://git.openstack.org/openstack/tempest'
dest: '{{ working_dir }}/tempest_git'
version: '{{ tempest_version }}'
when: release != 'newton'
- name: Cloning python-tempestconf
git:
repo: 'https://git.openstack.org/openstack/python-tempestconf'
dest: '{{ working_dir }}/tempestconf_git'
version: '{{ tempest_conf_version }}'
when: release != 'newton'
- name: Check if virtualenv is in the system
shell: "{{ python_cmd }} -m virtualenv --version"
register: virtualenv_exist
failed_when: false
changed_when: false
- when: virtualenv_exist.rc != 0
name: Install virtualenv
package:
state: present
name: >
{% if ansible_python.version.major == 3 %}
python3-virtualenv
{% else %}
python-virtualenv
{% endif %}
- name: Install packages required for create venv
package:
state: present
name:
- gcc
- libffi-devel
- openssl-devel
- name: Set tempest init command
set_fact:
tempest_init: "{{ working_dir }}/tempest_git/tools/{% if release == 'newton' %}configure-tempest-directory{% else %}with_env.sh tempest init{% endif %}"
- name: Set tempestconf call
set_fact:
tempestconf: "{% if release == 'newton' %}{{ working_dir }}/tools/config_tempest.py{% else %}{{ working_dir }}/tempest_git/tools/with_venv.sh discover-tempest-config{% endif %}"