Bläddra i källkod

Merge pull request #8274 from spadgett/verify-console-deployment

Check console ready replicas instead of curling service
Scott Dodson 7 år sedan
förälder
incheckning
90da94304f
1 ändrade filer med 12 tillägg och 11 borttagningar
  1. 12 11
      roles/openshift_web_console/tasks/start.yml

+ 12 - 11
roles/openshift_web_console/tasks/start.yml

@@ -1,13 +1,14 @@
 ---
-- name: Verify that the web console is running
-  uri:
-    url: https://webconsole.openshift-web-console.svc/healthz
-    validate_certs: no
-    return_content: yes
-  environment:
-    no_proxy: '*'
-  register: endpoint_health
-  until: "'ok' in endpoint_health.content"
+- name: Verify that the console is running
+  oc_obj:
+    namespace: openshift-web-console
+    kind: deployment
+    state: list
+    name: webconsole
+  register: console_deployment
+  until:
+  - console_deployment.results.results[0].status.readyReplicas is defined
+  - console_deployment.results.results[0].status.readyReplicas > 0
   retries: 60
   delay: 10
   changed_when: false
@@ -15,7 +16,7 @@
   ignore_errors: yes
 
 # Log the result of `oc status`, `oc get pods`, `oc get events`, and `oc logs deployment/webconsole` for troubleshooting failures.
-- when: "'ok' not in endpoint_health.content"
+- when: (console_deployment.results.results[0].status.readyReplicas is not defined) or (console_deployment.results.results[0].status.readyReplicas == 0)
   block:
   - name: Check status in the openshift-web-console namespace
     command: >
@@ -46,7 +47,7 @@
   - debug:
       msg: "{{ endpoint_log.stdout_lines }}"
 
-- when: "'ok' not in endpoint_health.content"
+- when: (console_deployment.results.results[0].status.readyReplicas is not defined) or (console_deployment.results.results[0].status.readyReplicas == 0)
   block:
   - name: Report console errors
     fail: