浏览代码

quit waiting for rhbk pod and go uri

Grega Bremec 1 月之前
父节点
当前提交
d5a73de5fe
共有 1 个文件被更改,包括 8 次插入14 次删除
  1. 8 14
      playbooks/roles/deploy-rhbk/tasks/present.yml

+ 8 - 14
playbooks/roles/deploy-rhbk/tasks/present.yml

@@ -340,21 +340,15 @@
       delay: 5
       when: created_import.changed
 
-    - name: Wait for the Keycloak pod to restart.
-      kubernetes.core.k8s_info:
-        kubeconfig: tmp/kubeconfig-ocp4
+    - name: Wait for the Keycloak pod to become ready.
+      ansible.builtin.uri:
+        return_content: yes
         validate_certs: no
-        api_version: v1
-        kind: pod
-        namespace: "{{ rhbk.namespace | default('keycloak') }}"
-        label_selectors:
-          - app=keycloak
-      register: rhbk_running
-      until:
-        - rhbk_running.resources is defined
-        - rhbk_running.resources | length > 0
-        - rhbk_running.resources[0].status.phase == "Running"
-        - (rhbk_running.resources[0].status | community.general.json_query('conditions[?type==`Ready`].status'))[0]
+        url: "https://{{ rhbk_fqdn }}/realms/{{ rhbk.realm | default('sample-realm') }}"
+      register: rhbk_is_back
+      until: rhbk_is_back.status == 200
+      retries: 24
+      delay: 5
       when: created_import.changed
 
   when: