summaryrefslogtreecommitdiffstats
path: root/playbooks/common
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2015-06-26 15:04:56 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2015-06-29 14:48:48 -0400
commitdf51a7dddad9e6f93a24c3ec07a07a661e6e168a (patch)
treecd0da961694e0a749aa1eef3f77699027dbc1dae /playbooks/common
parentaccd98845aac3e271295e3115501b25e6d72b114 (diff)
downloadopenshift-df51a7dddad9e6f93a24c3ec07a07a661e6e168a.tar.gz
openshift-df51a7dddad9e6f93a24c3ec07a07a661e6e168a.tar.bz2
openshift-df51a7dddad9e6f93a24c3ec07a07a661e6e168a.tar.xz
openshift-df51a7dddad9e6f93a24c3ec07a07a661e6e168a.zip
delegate_to doesn't appear to be thread safe
Diffstat (limited to 'playbooks/common')
-rw-r--r--playbooks/common/openshift-node/config.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml
index 2d2560db4..d3c223f50 100644
--- a/playbooks/common/openshift-node/config.yml
+++ b/playbooks/common/openshift-node/config.yml
@@ -135,3 +135,28 @@
roles:
- os_env_extras
- os_env_extras_node
+
+- name: Set scheduleability
+ serial: 1
+ hosts: oo_nodes_to_config
+ tasks:
+ - name: Check scheduleable state
+ delegate_to: "{{ openshift_first_master }}"
+ command: >
+ {{ openshift.common.client_binary }} get node {{ openshift.common.hostname }}
+ register: ond_get_node
+ until: ond_get_node.rc == 0
+ retries: 10
+ delay: 5
+
+ - name: Handle unscheduleable node
+ delegate_to: "{{ openshift_first_master }}"
+ command: >
+ {{ openshift.common.admin_binary }} manage-node {{ openshift.common.hostname }} --schedulable=false
+ when: openshift_scheduleable is defined and openshift_scheduleable == False and "SchedulingDisabled" not in ond_get_node.stdout
+
+ - name: Handle scheduleable node
+ delegate_to: "{{ openshift_first_master }}"
+ command: >
+ {{ openshift.common.admin_binary }} manage-node {{ openshift.common.hostname }} --schedulable=true
+ when: (openshift_scheduleable is not defined or openshift_scheduleable == True) and "SchedulingDisabled" in ond_get_node.stdout