summaryrefslogtreecommitdiffstats
path: root/playbooks/common
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2015-06-26 16:57:28 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2015-06-29 14:48:48 -0400
commitcde074730ed8278673498157008651d192c8236a (patch)
tree4ee6293daf334a825e9fcf1caa71ce42189a621d /playbooks/common
parentdf51a7dddad9e6f93a24c3ec07a07a661e6e168a (diff)
downloadopenshift-cde074730ed8278673498157008651d192c8236a.tar.gz
openshift-cde074730ed8278673498157008651d192c8236a.tar.bz2
openshift-cde074730ed8278673498157008651d192c8236a.tar.xz
openshift-cde074730ed8278673498157008651d192c8236a.zip
The manage_node commands should only run on the first master
Diffstat (limited to 'playbooks/common')
-rw-r--r--playbooks/common/openshift-node/config.yml36
1 files changed, 13 insertions, 23 deletions
diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml
index d3c223f50..0eec1ae61 100644
--- a/playbooks/common/openshift-node/config.yml
+++ b/playbooks/common/openshift-node/config.yml
@@ -137,26 +137,16 @@
- 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
+ hosts: oo_first_master
+ vars:
+ openshift_unscheduleable_nodes: "{{ hostvars
+ | oo_select_keys(groups['oo_nodes_to_config'])
+ | oo_collect('openshift_hostname', {'openshift_scheduleable': False}) }}"
+ pre_tasks:
+ - set_fact:
+ openshift_scheduleable_nodes: "{{ hostvars
+ | oo_select_keys(groups['oo_nodes_to_config'])
+ | oo_collect('openshift_hostname')
+ | difference(openshift_unscheduleable_nodes) }}"
+ roles:
+ - openshift_manage_node