wait_for_pods.yml 669 B

1234567891011121314
  1. ---
  2. - name: Wait for GlusterFS pods
  3. oc_obj:
  4. namespace: "{{ glusterfs_namespace }}"
  5. kind: pod
  6. state: list
  7. selector: "glusterfs={{ glusterfs_name }}-pod"
  8. register: glusterfs_pods
  9. until:
  10. - "glusterfs_pods.results.results[0]['items'] | count > 0"
  11. # There must be as many pods with 'Ready' staus True as there are nodes expecting those pods
  12. - "glusterfs_pods.results.results[0]['items'] | lib_utils_oo_collect(attribute='status.conditions') | lib_utils_oo_collect(attribute='status', filters={'type': 'Ready'}) | map('bool') | select | list | count == glusterfs_nodes | count"
  13. delay: 10
  14. retries: "{{ (glusterfs_timeout | int / 10) | int }}"