summaryrefslogtreecommitdiffstats
path: root/roles/openshift_manage_node
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_manage_node')
-rw-r--r--roles/openshift_manage_node/tasks/main.yml21
1 files changed, 21 insertions, 0 deletions
diff --git a/roles/openshift_manage_node/tasks/main.yml b/roles/openshift_manage_node/tasks/main.yml
new file mode 100644
index 000000000..637e494ea
--- /dev/null
+++ b/roles/openshift_manage_node/tasks/main.yml
@@ -0,0 +1,21 @@
+- name: Wait for Node Registration
+ command: >
+ {{ openshift.common.client_binary }} get node {{ item | lower }}
+ register: omd_get_node
+ until: omd_get_node.rc == 0
+ retries: 20
+ delay: 5
+ with_items: openshift_nodes
+
+- name: Set node schedulability
+ command: >
+ {{ openshift.common.admin_binary }} manage-node {{ item.openshift.common.hostname | lower }} --schedulable={{ 'true' if item.openshift.node.schedulable | bool else 'false' }}
+ with_items:
+ - "{{ openshift_node_vars }}"
+
+- name: Label nodes
+ command: >
+ {{ openshift.common.client_binary }} label --overwrite node {{ item.openshift.common.hostname | lower }} {{ item.openshift.node.labels | oo_combine_dict }}
+ with_items:
+ - "{{ openshift_node_vars }}"
+ when: "'labels' in item.openshift.node and item.openshift.node.labels != {}"