Andriy Kurilin 4a9a54864f [ci] Generate a real raw and qcow2 image sfor tests
Also, this reduces payloadin neutron-trunk job. There is no indent to
test neutron as a part of Rally CI. And adds basic linting for ansible

Change-Id: I8129ae939d24d59688a535cdbbeff5d5f89f45c7
2025-03-03 12:33:28 +01:00

41 lines
1.4 KiB
YAML

- name: Run Rally task
become: true
become_user: stack
shell:
cmd: |
export RALLY_PLUGINS_DIR="{{ rally_home_dir }}/plugins"
export RALLY_EXTRA_DIR="{{ rally_home_dir }}/extra"
rally --rally-debug task start --task {{ rally_home_dir }}/task.yaml #--task-args-file {{ rally_home_dir }}/task_args_file.yaml
executable: /bin/bash
register: command_result
ignore_errors: true
- name: Check rally task exit code
become: true
become_user: stack
shell:
cmd: |
STATUS="OK"
EXIT_CODE=0
if [ "{{ command_result.rc }}" -eq "2" ]; then
STATUS="At least one workload did not pass SLA criteria."
EXIT_CODE=0
# actually, InvalidTaskException has 457 error code, but exit codes are
# limited by the range 0-255 . So 457 means 201... need to fix exit
# codes
elif [ "{{ command_result.rc }} " -eq "201" ]; then
STATUS="Task config is invalid. Check logs for validation errors."
# no results can be produced. stop play
EXIT_CODE=1
elif [ "{{ command_result.rc }}" -ne "0" ]; then
STATUS="Unexpected error had happened while launching Rally task. Check logs for more details."
EXIT_CODE=1
fi
# dump status, so it can be parsed in post script
echo "$STATUS" > "{{ rally_results_dir }}/status.txt"
exit $EXIT_CODE