Add kubespray to perform the result check 19/61619/2
authoryjun <xy.0520@hotmail.com>
Fri, 31 Aug 2018 03:04:45 +0000 (19:04 -0800)
committeryjun <xy.0520@hotmail.com>
Fri, 14 Sep 2018 02:41:31 +0000 (18:41 -0800)
Change-Id: I61f4d97e68e137d4cadfad1dd260c69788946c47
Signed-off-by: yjun <xy.0520@hotmail.com>
deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml

index 0e25312..338f257 100644 (file)
@@ -282,3 +282,16 @@ kube-controller-manager.manifest.j2",
                      -e "@extra-vars.yml" -b -v 2>&1  | tee kargo.log
   tags:
     - ansible
+
+- name: read the ansible log file
+  shell: "cat /opt/kargo_k8s/kargo.log | tail -n 1000"
+  register: setup_kargo_result
+
+- fail:
+    msg: "some task failed when setup kargo."
+  when: setup_kargo_result.stdout.find('failed=1') != -1
+
+- fail:
+    msg: "some host are unreachable."
+  when: setup_kargo_result.stdout.find('unreachable=1') != -1
+  run_once: true