125 lines
4.1 KiB
YAML
125 lines
4.1 KiB
YAML
---
|
|
- name: Fail the tempest playbook on undefined cloud name and install method
|
|
fail:
|
|
msg: |
|
|
The variable tempest_install_method and tempest_cloud_name is required and
|
|
has not been set.
|
|
when:
|
|
- tempest_install_method is not defined
|
|
- tempest_cloud_name is not defined
|
|
|
|
- name: Initialize neutron service for network creation
|
|
set_fact:
|
|
tempest_service_available_neutron: true
|
|
|
|
- name: Create /root/.config/openstack directory
|
|
file:
|
|
state: directory
|
|
path: "/root/.config/openstack"
|
|
mode: 0700
|
|
become: true
|
|
|
|
- name: Copy clouds.yaml file to /root directory
|
|
block:
|
|
- name: Copy clouds.yaml file from user's home to /root directory
|
|
copy:
|
|
src: '{{ ansible_user_dir }}/.config/openstack/clouds.yaml'
|
|
remote_src: true
|
|
dest: '/root/.config/openstack/clouds.yaml'
|
|
mode: 0600
|
|
become: true
|
|
rescue:
|
|
- name: Copy clouds.yaml file /etc/openstack to /root directory
|
|
copy:
|
|
src: '/etc/openstack/clouds.yaml'
|
|
remote_src: true
|
|
dest: '/root/.config/openstack/clouds.yaml'
|
|
mode: 0600
|
|
become: true
|
|
|
|
- name: Set network vars
|
|
set_fact:
|
|
tempest_public_net_physical_type: 'datacentre'
|
|
tempest_private_net_provider_type: 'geneve'
|
|
tempest_public_subnet_cidr: '{{ tempest_cidr }}'
|
|
tempest_public_subnet_gateway_ip: '{{ tempest_cidr|nthhost(1) }}'
|
|
tempest_public_subnet_allocation_pools: '{{ tempest_cidr|nthhost(100) ~ "-" ~ tempest_cidr|nthhost(150) }}'
|
|
tempest_network_ping_gateway: true
|
|
when: tempest_cidr is defined
|
|
|
|
- name: Set tempest workspace related vars
|
|
set_fact:
|
|
tempest_use_tempestconf: true
|
|
tempest_service_setup_host: '{{ inventory_hostname }}'
|
|
tempest_workspace: "{{ ansible_user_dir }}/tempest"
|
|
stackviz_venv_bin: "{{ ansible_user_dir }}/stackviz_venv/bin"
|
|
|
|
- name: set facts while running tempest from source
|
|
set_fact:
|
|
tempest_git_repo: https://opendev.org/openstack/tempest
|
|
tempest_tempestconf_git_repo: https://opendev.org/openstack/python-tempestconf
|
|
tempest_tempestconf_venv_bin: "{{ ansible_user_dir }}/tempestconf_venv/bin"
|
|
tempest_venv_bin: "{{ ansible_user_dir }}/tempest_venv/bin"
|
|
when: tempest_install_method == 'source'
|
|
|
|
- name: set cirros image facts for periodic
|
|
set_fact:
|
|
tempest_tempestconf_profile_extras:
|
|
image: http://images.rdoproject.org/cirros/cirros-0.4.0-x86_64-disk.img
|
|
|
|
# stackviz in venv pulls oslo.db due upstream constraints,
|
|
# but it dropped py2 support so on such system we need to skip it
|
|
# https://bugs.launchpad.net/tripleo/+bug/1862134
|
|
- name: disable stackviz in python2 environment
|
|
set_fact:
|
|
tempest_run_stackviz: false
|
|
when:
|
|
- release|default('master') in ['master', 'train']
|
|
- ansible_distribution|lower in ['redhat', 'centos']
|
|
- ansible_distribution_major_version is version('7', '==')
|
|
|
|
- name: Load tempest skiplist file
|
|
include_vars: "{{ playbook_dir | dirname }}/vars/tempest_skip_{{ release | default('master') }}.yml"
|
|
|
|
# TODO(arxcruz): For now this is the easiest way to fix this:
|
|
# os_tempest uses the variable tempest_test_blacklist while we use
|
|
# known_failures. Change now, means a lot of changes on other parts of the code
|
|
# (tempestmail, validate-tempest, etc). Once we migrate to os_tempest we can
|
|
# switch that.
|
|
- name: Set tempest_test_blacklist
|
|
set_fact:
|
|
tempest_test_blacklist: "{{ known_failures | json_query('[?undercloud != `true`]') }}"
|
|
when: tempest_cloud_name != 'undercloud'
|
|
|
|
- name: set python_cmd
|
|
set_fact:
|
|
python_cmd: "python{{ ansible_python.version.major }}"
|
|
cacheable: true
|
|
when: python_cmd is not defined
|
|
|
|
- name: Check if virtualenv is in the system
|
|
command: "{{ python_cmd }} -m virtualenv --version"
|
|
register: virtualenv_exist
|
|
failed_when: false
|
|
changed_when: false
|
|
|
|
- when: virtualenv_exist.rc != 0
|
|
name: Install virtualenv
|
|
become: true
|
|
package:
|
|
state: present
|
|
name: >
|
|
{% if ansible_python.version.major == 3 %}
|
|
python3-virtualenv
|
|
{% else %}
|
|
python-virtualenv
|
|
{% endif %}
|
|
|
|
- name: Run os_tempest role
|
|
vars:
|
|
ansible_become: true
|
|
debug: true
|
|
tempest_run: 'yes'
|
|
include_role:
|
|
name: os_tempest
|