summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-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