From eab4b15aeb1204989355705fe2ecdf184d8bbb8b Mon Sep 17 00:00:00 2001 From: Hugh Saunders Date: Fri, 11 Dec 2015 13:10:41 +0000 Subject: [PATCH] Use http request to check cinder api availability Using a port open check is not reliable when going through a load balancer. httplib2 is added as it is required by the Ansible uri module. Change-Id: I0e489e8f671b262c56c1442e7af85fd53c061598 Closes-bug: #1525208 Closes-Bug: #1510990 --- playbooks/roles/os_cinder/defaults/main.yml | 1 + playbooks/roles/os_cinder/tasks/cinder_backends.yml | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/playbooks/roles/os_cinder/defaults/main.yml b/playbooks/roles/os_cinder/defaults/main.yml index dbb5acc1e6..e6da8560c8 100644 --- a/playbooks/roles/os_cinder/defaults/main.yml +++ b/playbooks/roles/os_cinder/defaults/main.yml @@ -232,6 +232,7 @@ cinder_requires_pip_packages: - virtualenv - virtualenv-tools - python-keystoneclient # Keystoneclient needed to OSA keystone lib + - httplib2 # Common pip packages cinder_pip_packages: diff --git a/playbooks/roles/os_cinder/tasks/cinder_backends.yml b/playbooks/roles/os_cinder/tasks/cinder_backends.yml index f55919437b..647d683ad8 100644 --- a/playbooks/roles/os_cinder/tasks/cinder_backends.yml +++ b/playbooks/roles/os_cinder/tasks/cinder_backends.yml @@ -13,11 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Ensure cinder api ip/port are responsive - wait_for: - port: "{{ cinder_service_port }}" - delay: 10 - host: "{{ internal_lb_vip_address }}" +- name: Ensure cinder api is available + uri: + url: "{{ cinder_service_internaluri }}" + status_code: 200 + register: api_status + until: api_status |success + retries: 10 + delay: 10 tags: - cinder-backends