From 49c083f5552edb057309634ef6cdd3432713e922 Mon Sep 17 00:00:00 2001 From: Bertrand Lallau Date: Sat, 10 Jun 2017 22:42:54 +0200 Subject: [PATCH] Fix "Enable influxdb datasource" random error Sometimes the "Enable influxdb datasource" task failed with "503 Service Unavailable" error. Waiting for grafana port UP seems not always enough, it requires to wait for application ready. Change-Id: I3a27b3086698b89a80a3f585beb810831289ae7a Closes-Bug: #1697213 --- ansible/roles/grafana/tasks/post_config.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ansible/roles/grafana/tasks/post_config.yml b/ansible/roles/grafana/tasks/post_config.yml index 3833c1fdee..a3615505f0 100644 --- a/ansible/roles/grafana/tasks/post_config.yml +++ b/ansible/roles/grafana/tasks/post_config.yml @@ -1,8 +1,14 @@ --- -- name: Wait for grafana port - wait_for: - host: "{{ api_interface_address }}" - port: "{{ grafana_server_port }}" +- name: Wait for grafana application ready + uri: + url: "{{ internal_protocol }}://{{ kolla_internal_vip_address }}:{{ grafana_server_port }}" + status_code: 200 + register: result + until: result.status == 200 + retries: 10 + delay: 2 + run_once: true + connection: local - name: Enable influxdb datasource uri: