start.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ---
  2. - name: Waiting for console rollout to complete
  3. # `oc rollout status` will block until either the rollout succeeds or `spec.progressDeadlineSeconds` elapse.
  4. # A zero return code indicates the rollout succeeded.
  5. # https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#complete-deployment
  6. command: >
  7. {{ openshift_client_binary }} rollout status deployment/console --config={{ openshift.common.config_base }}/master/admin.kubeconfig -n openshift-console
  8. changed_when: false
  9. # Ignore errors so we can log troubleshooting info on failures.
  10. ignore_errors: yes
  11. register: console_rollout_status
  12. # Log the result of `oc status`, `oc get pods`, `oc get events`, and `oc logs deployment/console` for troubleshooting failures.
  13. - when: console_rollout_status.rc != 0
  14. block:
  15. - name: Check status in the openshift-console namespace
  16. command: >
  17. {{ openshift_client_binary }} status --config={{ openshift.common.config_base }}/master/admin.kubeconfig -n openshift-console
  18. register: endpoint_status
  19. ignore_errors: true
  20. - debug:
  21. msg: "{{ endpoint_status.stdout_lines }}"
  22. - name: Get pods in the openshift-console namespace
  23. command: >
  24. {{ openshift_client_binary }} get pods --config={{ openshift.common.config_base }}/master/admin.kubeconfig -n openshift-console -o wide
  25. register: endpoint_pods
  26. ignore_errors: true
  27. - debug:
  28. msg: "{{ endpoint_pods.stdout_lines }}"
  29. - name: Get events in the openshift-console namespace
  30. command: >
  31. {{ openshift_client_binary }} get events --config={{ openshift.common.config_base }}/master/admin.kubeconfig --sort-by='.metadata.creationTimestamp' -n openshift-console
  32. register: endpoint_events
  33. ignore_errors: true
  34. - debug:
  35. msg: "{{ endpoint_events.stdout_lines }}"
  36. - name: Get console pod logs
  37. command: >
  38. {{ openshift_client_binary }} logs deployment/console --tail=50 --config={{ openshift.common.config_base }}/master/admin.kubeconfig -n openshift-console
  39. register: endpoint_log
  40. ignore_errors: true
  41. - debug:
  42. msg: "{{ endpoint_log.stdout_lines }}"
  43. - name: Report console errors
  44. fail:
  45. msg: Console install failed.