Browse Source

Wait for sync DS to set annotations on all available nodes

Vadim Rutkovsky 6 years ago
parent
commit
1dfec5561a
1 changed files with 18 additions and 0 deletions
  1. 18 0
      roles/openshift_manage_node/tasks/config.yml

+ 18 - 0
roles/openshift_manage_node/tasks/config.yml

@@ -9,3 +9,21 @@
   until: node_schedulable is succeeded
   when: "'nodename' in openshift.node"
   delegate_to: "{{ openshift_master_host }}"
+
+- name: Wait for sync DS to set annotations on all nodes
+  oc_obj:
+    state: list
+    kind: node
+    selector: ""
+  register: node_status
+  until:
+    - node_status.results is defined
+    - node_status.results.results is defined
+    - node_status.results.results | length > 0
+    - node_status.results.results[0]['items']
+        | map(attribute='metadata.annotations') | map('list') | flatten
+        | select('match', '[\"node.openshift.io/md5sum\"]') | list | length ==
+      node_status.results.results[0]['items'] | length
+  retries: 60
+  delay: 10
+  delegate_to: "{{ openshift_master_host }}"