Run validation only if overcloud exists.

When no overcloud is deployed, the openstack-endpoint.yaml validations
fail. This patch re-orders couple of tasks and runs the failing task for
unavailable endpoints only when an overcloud exists.

Change-Id: I174b5a239a7c1ab7b93323654a417db8f087bc27
Story: #2002061
(cherry picked from commit 864ab1d64d)
This commit is contained in:
Jose Luis Franco Arza 2018-05-17 17:29:58 +02:00 committed by Cédric Jeanneret (Tengu)
parent df05c075d4
commit 2cfc6c7ba7
1 changed files with 14 additions and 4 deletions

View File

@ -12,16 +12,29 @@
- pre-upgrade - pre-upgrade
- post-upgrade - post-upgrade
tasks: tasks:
- name: Set fact to identify if the overcloud was deployed
set_fact:
overcloud_deployed: "{{ groups['overcloud'] is defined }}"
# Check that the Horizon endpoint exists # Check that the Horizon endpoint exists
- name: Fail if the HorizonPublic endpoint is not defined - name: Fail if the HorizonPublic endpoint is not defined
fail: msg="The `HorizonPublic` endpoint is not defined in the `EndpointMap` of the deployed stack. This means Horizon may not have been deployed correctly." fail: msg="The `HorizonPublic` endpoint is not defined in the `EndpointMap` of the deployed stack. This means Horizon may not have been deployed correctly."
when: overcloud_horizon_url|default('') == '' when:
- overcloud_horizon_url|default('') == ''
- overcloud_deployed|bool
# Check connectivity to horizon # Check connectivity to horizon
- name: Check Horizon - name: Check Horizon
uri: url={{ overcloud_horizon_url }} uri: url={{ overcloud_horizon_url }}
when: overcloud_horizon_url|default('') when: overcloud_horizon_url|default('')
# Check that the Keystone endpoint exists
- name: Fail if KeystoneURL output is not available
fail: msg="The `KeystoneURL` output is not available in the deployed stack."
when:
- overcloud_keystone_url|default('') == ''
- overcloud_deployed|bool
# Check that we can obtain an auth token from horizon # Check that we can obtain an auth token from horizon
- name: Check Keystone - name: Check Keystone
uri: uri:
@ -44,8 +57,5 @@
register: auth_token register: auth_token
when: overcloud_keystone_url|default('') when: overcloud_keystone_url|default('')
- name: Fail if KeystoneURL output is not available
fail: msg="The `KeystoneURL` output is not available in the deployed stack."
when: overcloud_keystone_url|default('') == ''
# TODO(shadower): other endpoints # TODO(shadower): other endpoints