diff options
author | Andrew Butcher <abutcher@redhat.com> | 2016-09-07 14:50:34 -0400 |
---|---|---|
committer | Andrew Butcher <abutcher@redhat.com> | 2016-09-07 14:50:34 -0400 |
commit | 75d4f13ad39a770a8954aef9507e5d136ecb3306 (patch) | |
tree | 8bbbce4d390f09292593119db10046a11803ab09 | |
parent | 4158ea7fbf9b31a803413a51a6a01fc7f2902e9c (diff) | |
download | openshift-75d4f13ad39a770a8954aef9507e5d136ecb3306.tar.gz openshift-75d4f13ad39a770a8954aef9507e5d136ecb3306.tar.bz2 openshift-75d4f13ad39a770a8954aef9507e5d136ecb3306.tar.xz openshift-75d4f13ad39a770a8954aef9507e5d136ecb3306.zip |
Don't loop over hostvars when setting node schedulability.
-rw-r--r-- | playbooks/common/openshift-node/config.yml | 1 | ||||
-rw-r--r-- | roles/openshift_manage_node/tasks/main.yml | 12 |
2 files changed, 6 insertions, 7 deletions
diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index e7c7ffb38..94c30e268 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -159,7 +159,6 @@ openshift_nodes: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']) | oo_collect('openshift.common.hostname') }}" - openshift_node_vars: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']) }}" pre_tasks: # Necessary because when you're on a node that's also a master the master will be # restarted after the node restarts docker and it will take up to 60 seconds for diff --git a/roles/openshift_manage_node/tasks/main.yml b/roles/openshift_manage_node/tasks/main.yml index 115c44067..f999092cc 100644 --- a/roles/openshift_manage_node/tasks/main.yml +++ b/roles/openshift_manage_node/tasks/main.yml @@ -26,21 +26,21 @@ - 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' }} + {{ openshift.common.admin_binary }} manage-node {{ hostvars[item].openshift.common.hostname | lower }} --schedulable={{ 'true' if hostvars[item].openshift.node.schedulable | bool else 'false' }} --config={{ openshift_manage_node_kubeconfig }} -n default with_items: - - "{{ openshift_node_vars }}" - when: item.openshift.common.hostname is defined + - "{{ openshift_nodes }}" + when: hostvars[item].openshift.common.hostname is defined - name: Label nodes command: > - {{ openshift.common.client_binary }} label --overwrite node {{ item.openshift.common.hostname | lower }} {{ item.openshift.node.labels | oo_combine_dict }} + {{ openshift.common.client_binary }} label --overwrite node {{ hostvars[item].openshift.common.hostname | lower }} {{ hostvars[item].openshift.node.labels | oo_combine_dict }} --config={{ openshift_manage_node_kubeconfig }} -n default with_items: - - "{{ openshift_node_vars }}" - when: item.openshift.common.hostname is defined and 'labels' in item.openshift.node and item.openshift.node.labels != {} + - "{{ openshift_nodes }}" + when: hostvars[item].openshift.common.hostname is defined and 'labels' in hostvars[item].openshift.node and hostvars[item].openshift.node.labels != {} - name: Delete temp directory file: |