summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2015-07-08 23:19:27 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2015-07-10 04:28:40 -0400
commit025011c1e462d8419b81d8c5085cb92163ac4280 (patch)
tree4fb0521c26e69ebf17428761ae29c3b6c44a9671
parentb03b50a7a408470c28f2c8d1752cda541b75f8ee (diff)
downloadopenshift-025011c1e462d8419b81d8c5085cb92163ac4280.tar.gz
openshift-025011c1e462d8419b81d8c5085cb92163ac4280.tar.bz2
openshift-025011c1e462d8419b81d8c5085cb92163ac4280.tar.xz
openshift-025011c1e462d8419b81d8c5085cb92163ac4280.zip
Bug 1241342 - Adding retry logic to handle node registration race conditions
-rw-r--r--playbooks/common/openshift-node/config.yml3
-rw-r--r--roles/openshift_manage_node/tasks/main.yml9
2 files changed, 12 insertions, 0 deletions
diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml
index 2017a7156..1cf5616ce 100644
--- a/playbooks/common/openshift-node/config.yml
+++ b/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}) }}"
diff --git a/roles/openshift_manage_node/tasks/main.yml b/roles/openshift_manage_node/tasks/main.yml
index b9ab16e7c..d17f3f532 100644
--- a/roles/openshift_manage_node/tasks/main.yml
+++ b/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