1
0
mirror of https://github.com/openshift/openshift-ansible.git synced 2026-02-05 15:45:57 +01:00

Merge pull request #10885 from vrutkovs/devel-40-bootkube-logs

Collect bootkube logs if MCS failed to start
This commit is contained in:
OpenShift Merge Robot
2018-12-21 09:09:23 -08:00
committed by GitHub
2 changed files with 32 additions and 1 deletions

View File

@@ -38,6 +38,37 @@
vars:
excluded_services:
- progress.service
- name: Wait for MCS endpoint to show up
uri:
url: "{{ mcd_endpoint }}/config/master"
validate_certs: false
delay: 10
retries: 60
register: mcs
until:
- "'status' in mcs"
- mcs.status == 200
ignore_errors: true
- when: mcs is failed
block:
- name: Get node logs
command: journalctl --no-pager -u bootkube
register: bootkube_logs
ignore_errors: true
- name: Collect a list of containers
command: crictl ps -a -q
register: crictl_ps_output
- name: Collect container logs
command: "crictl logs {{ item }}"
register: crictl_logs_output
with_items: "{{ crictl_ps_output.stdout_lines }}"
ignore_errors: true
- debug:
var: crictl_logs_output
- debug:
msg: "{{ bootkube_logs.stdout_lines }}"
- fail:
msg: MCS start failed.
- name: Start masters
hosts: masters