14c1759676
Dont rely on strings when checking overcloud deploy result, just check code status of command. Change-Id: Ib9342ea169229dc8747579b2ed96bdd396b9f314
26 lines
1.0 KiB
YAML
26 lines
1.0 KiB
YAML
---
|
|
|
|
# The purpose of writing the overcloud status out to a json file is to
|
|
# allow ansible to capture the status, and then execute required steps
|
|
# after the deployment fails e.g. inventory
|
|
# After the deployment fails and inventory is collected the playbook then
|
|
# checks the status via the json file and passes or fails at the appropriate
|
|
# time.
|
|
- name: write out overcloud status to a file on the localhost
|
|
shell: >
|
|
echo '{ "overcloud_deploy_result": "failed" }' > "{{ local_working_dir }}/overcloud_deployment_result.json"
|
|
delegate_to: localhost
|
|
when: deploy_script_result.rc != 0
|
|
|
|
- name: write out overcloud status to a file on the localhost
|
|
shell: >
|
|
echo '{ "overcloud_deploy_result": "passed" }' > "{{ local_working_dir }}/overcloud_deployment_result.json"
|
|
delegate_to: localhost
|
|
when: deploy_script_result.rc == 0
|
|
|
|
- name: import deployment status from file
|
|
include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json"
|
|
|
|
- name: echo deployment_status
|
|
debug: var=overcloud_deploy_result
|