ansible-role-refstack-client/tasks/main.yaml
Martin Kopec f865af4563 Fix inspecting refstack_result
refstack_result is used to register result of running
refstack-client, however, it was used in 2 different tasks one of
which was always skipped. There may happen a situation (when the
latter task is skipped), the skipped task overrides the result
of the refstack-client execution from the other task.
The patch fixes that by using a different variable for each of
the tasks running refstack-client.

Change-Id: I6f524df674dfbb2d6b9372dce51f1e1aec8ed9be
2021-05-17 18:38:24 +00:00

46 lines
1.3 KiB
YAML

---
- name: Install required packages
include: install-packages.yaml
- include_tasks: install-refstack-client.yaml
- name: Generate accounts.yaml file
include: generate-accounts.yaml
when: accounts_path is not defined
- name: Set path to provided accounts.yaml
set_fact:
path_to_accounts_file: "{{ accounts_path }}"
when: accounts_path is defined
- name: Generate tempest.conf file
include: generate-tempestconf.yaml
when: tempest_config_path is not defined
- name: Set path to provided tempest.conf
set_fact:
path_to_tempest_config: "{{ tempest_config_path }}"
when: tempest_config_path is defined
- include_tasks: run-refstack-client.yaml
- include_tasks: post-tasks.yaml
when: upload_results | bool or download_artifacts | bool
- when: test_list is defined
block:
- name: Check if we passed refstack tests
fail:
msg: "Refstack tests failed."
# the refstack_result var got set in run-refstack-client.yaml
when: refstack_result.rc > 0
- when: test_list is not defined
block:
- name: Check if we passed tests of all specified target programs
fail:
msg: "Refstack tests failed."
# the refstack_results var got set in run-refstack-client.yaml
when: item.rc > 0
with_items: "{{ refstack_results.results }}"