---
- name: gather facts used by role
  setup:
    gather_subset: "!min,python,processor"
  when: >
    ansible_python is not defined or
    ansible_processor_vcpus is not defined

- name: set python_cmd
  set_fact:
    python_cmd: "python{{ ansible_python.version.major }}"
    cacheable: true
  when: python_cmd is not defined

- name: change python_package_prefix for python > 2
  set_fact:
    python_package_prefix: "python{{ ansible_python.version.major }}"
    cacheable: true
  when: ansible_python.version.major > 2

- include: tempest-venv.yml
  when: tempest_config|bool and tempest_format == 'venv'
  tags:
    - pre-tempest-config

- include: tempest-rpm.yml
  when: tempest_config|bool and tempest_format == 'packages'
  tags:
    - pre-tempest-config

- include: tempest-containers.yml
  when: tempest_config|bool and tempest_format == 'container'
  tags:
    - pre-tempest-config

- include: pre-tempest.yml
  when: tempest_config|bool or run_tempest|bool
  tags:
    - pre-tempest-config

- include: run-tempest.yml
  when: run_tempest|bool
  tags:
    - run-tempest

- include: tempest-results.yml
  when: run_tempest|bool
  tags:
    - tempest-results

- include: stackviz.yml
  when: run_tempest|bool
  tags:
    - run-stackviz
  ignore_errors: true

- include: post-tempest.yml
  when: post_tempest|bool and run_tempest|bool
  tags:
    - post-tempest
