Переглянути джерело

Merge pull request #332 from brenton/master

Adding retry logic to handle node registration race conditions
Brenton Leanhardt 9 роки тому
батько
коміт
14bde2f7d9

+ 3 - 0
playbooks/common/openshift-node/config.yml

@@ -139,6 +139,9 @@
 - name: Set scheduleability
   hosts: oo_first_master
   vars:
+    openshift_nodes: "{{ hostvars
+                         | oo_select_keys(groups['oo_nodes_to_config'])
+                         | oo_collect('openshift.common.hostname') }}"
     openshift_unscheduleable_nodes: "{{ hostvars
                                         | oo_select_keys(groups['oo_nodes_to_config']) 
                                         | oo_collect('openshift.common.hostname', {'openshift_scheduleable': False}) }}"

+ 9 - 0
roles/openshift_manage_node/tasks/main.yml

@@ -1,3 +1,12 @@
+- name: Wait for Node Registration
+  command: >
+      {{ openshift.common.client_binary }} get node {{ item }}
+  register: omd_get_node
+  until: omd_get_node.rc == 0
+  retries: 10
+  delay: 5
+  with_items: openshift_nodes
+
 - name: Handle unscheduleable node
   command: >
     {{ openshift.common.admin_binary }} manage-node {{ item }} --schedulable=false