summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-06-22 15:50:58 -0400
committerThomas Wiest <twiest@users.noreply.github.com>2015-06-22 15:50:58 -0400
commitcf1fb0bedbc4fb181c21749dbbe503abc71b21fd (patch)
treea9394877a3cfb39d40b83f475f26520f485dc5cc
parentc7d674b0bf6c4804f26808f49b0ceff2500b852b (diff)
parent66dd4499a7e17b985f6033370e5e8b5a9c8f04ac (diff)
downloadopenshift-cf1fb0bedbc4fb181c21749dbbe503abc71b21fd.tar.gz
openshift-cf1fb0bedbc4fb181c21749dbbe503abc71b21fd.tar.bz2
openshift-cf1fb0bedbc4fb181c21749dbbe503abc71b21fd.tar.xz
openshift-cf1fb0bedbc4fb181c21749dbbe503abc71b21fd.zip
Merge pull request #294 from brenton/master
Adding support for labeling nodes as unscheduleable
-rw-r--r--roles/openshift_node/tasks/main.yml21
1 files changed, 21 insertions, 0 deletions
diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml
index 770b55351..4789dec85 100644
--- a/roles/openshift_node/tasks/main.yml
+++ b/roles/openshift_node/tasks/main.yml
@@ -73,3 +73,24 @@
- name: Start and enable openshift-node
service: name=openshift-node enabled=yes state=started
+
+- name: Check scheduleable state
+ delegate_to: "{{ openshift_first_master }}"
+ command: >
+ {{ openshift.common.client_binary }} get node {{ inventory_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 {{ inventory_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 {{ inventory_hostname }} --schedulable=true
+ when: (openshift_scheduleable is not defined or openshift_scheduleable == True) and "SchedulingDisabled" in ond_get_node.stdout