diff options
author | Andrew Butcher <abutcher@afrolegs.com> | 2016-09-09 10:37:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-09 10:37:16 -0400 |
commit | 242aeba73a60a7ad113a80e8141478fe67b695a5 (patch) | |
tree | 32ba0a33db368609dc71ec8a84141af30b5e9566 | |
parent | eaf2932db8d86bf47cf54a5da4315c464b1c7abe (diff) | |
parent | 70c62ffe21b7b90c23a8a35d4d52c4e23091e421 (diff) | |
download | openshift-242aeba73a60a7ad113a80e8141478fe67b695a5.tar.gz openshift-242aeba73a60a7ad113a80e8141478fe67b695a5.tar.bz2 openshift-242aeba73a60a7ad113a80e8141478fe67b695a5.tar.xz openshift-242aeba73a60a7ad113a80e8141478fe67b695a5.zip |
Merge pull request #2422 from abutcher/manage-node-hostnames
Fix node label / schedulability when inventory_hostname != openshift.common.hostname
-rw-r--r-- | playbooks/common/openshift-node/config.yml | 4 | ||||
-rw-r--r-- | roles/openshift_manage_node/tasks/main.yml | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index 94c30e268..66eb293e5 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -156,9 +156,7 @@ - name: Set schedulability hosts: oo_first_master vars: - openshift_nodes: "{{ hostvars - | oo_select_keys(groups['oo_nodes_to_config']) - | oo_collect('openshift.common.hostname') }}" + openshift_nodes: "{{ groups.oo_nodes_to_config | default([]) }}" 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 f999092cc..f45ade751 100644 --- a/roles/openshift_manage_node/tasks/main.yml +++ b/roles/openshift_manage_node/tasks/main.yml @@ -14,7 +14,7 @@ - name: Wait for Node Registration command: > - {{ openshift.common.client_binary }} get node {{ item | lower }} + {{ openshift.common.client_binary }} get node {{ hostvars[item].openshift.common.hostname | lower }} --config={{ openshift_manage_node_kubeconfig }} -n default register: omd_get_node @@ -29,8 +29,7 @@ {{ 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_nodes }}" + with_items: "{{ openshift_nodes }}" when: hostvars[item].openshift.common.hostname is defined - name: Label nodes @@ -38,8 +37,7 @@ {{ 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_nodes }}" + with_items: "{{ 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 |