start.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ---
  2. - name: Verify that the web console is running
  3. command: >
  4. curl -k https://webconsole.openshift-web-console.svc/healthz
  5. args:
  6. # Disables the following warning:
  7. # Consider using get_url or uri module rather than running curl
  8. warn: no
  9. register: endpoint_health
  10. until: endpoint_health.stdout == 'ok'
  11. retries: 60
  12. delay: 10
  13. changed_when: false
  14. # Ignore errors so we can log troubleshooting info on failures.
  15. ignore_errors: yes
  16. # Log the result of `oc status`, `oc get pods`, `oc get events`, and `oc logs deployment/webconsole` for troubleshooting failures.
  17. - when: endpoint_health.stdout != 'ok'
  18. block:
  19. - name: Check status in the openshift-web-console namespace
  20. command: >
  21. {{ openshift_client_binary }} status --config={{ mktemp.stdout }}/admin.kubeconfig -n openshift-web-console
  22. register: endpoint_status
  23. ignore_errors: true
  24. - debug:
  25. msg: "{{ endpoint_status.stdout_lines }}"
  26. - name: Get pods in the openshift-web-console namespace
  27. command: >
  28. {{ openshift_client_binary }} get pods --config={{ mktemp.stdout }}/admin.kubeconfig -n openshift-web-console -o wide
  29. register: endpoint_pods
  30. ignore_errors: true
  31. - debug:
  32. msg: "{{ endpoint_pods.stdout_lines }}"
  33. - name: Get events in the openshift-web-console namespace
  34. command: >
  35. {{ openshift_client_binary }} get events --config={{ mktemp.stdout }}/admin.kubeconfig -n openshift-web-console
  36. register: endpoint_events
  37. ignore_errors: true
  38. - debug:
  39. msg: "{{ endpoint_events.stdout_lines }}"
  40. - name: Get console pod logs
  41. command: >
  42. {{ openshift_client_binary }} logs deployment/webconsole --tail=50 --config={{ mktemp.stdout }}/admin.kubeconfig -n openshift-web-console
  43. register: endpoint_log
  44. ignore_errors: true
  45. - debug:
  46. msg: "{{ endpoint_log.stdout_lines }}"
  47. - when: endpoint_health.stdout != 'ok'
  48. block:
  49. - name: Report console errors
  50. fail:
  51. msg: Console install failed.