소스 검색

Test MCS endpoint on bootstrap to fail early if its unavailable and collect logs

Vadim Rutkovsky 6 년 전
부모
커밋
c0ede0d3d1
1개의 변경된 파일21개의 추가작업 그리고 0개의 파일을 삭제
  1. 21 0
      playbooks/deploy_cluster_40.yml

+ 21 - 0
playbooks/deploy_cluster_40.yml

@@ -38,6 +38,27 @@
     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
+    - debug:
+        msg: "{{ bootkube_logs.stdout_lines }}"
+    - fail:
+        msg: MCS start failed.
 
 - name: Start masters
   hosts: masters