summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Rutkovsky <vrutkovs@redhat.com>2018-01-24 22:50:25 +0100
committerVadim Rutkovsky <vrutkovs@redhat.com>2018-01-24 23:04:50 +0100
commit4e2272db05cf00335701aa6db5ecfd9195623d35 (patch)
tree2fcdc3a55e723a318fd6b76cb5252926a29fab33
parentf83c41821322d74db35493fcc3a4fcd1c0359bf5 (diff)
downloadopenshift-4e2272db05cf00335701aa6db5ecfd9195623d35.tar.gz
openshift-4e2272db05cf00335701aa6db5ecfd9195623d35.tar.bz2
openshift-4e2272db05cf00335701aa6db5ecfd9195623d35.tar.xz
openshift-4e2272db05cf00335701aa6db5ecfd9195623d35.zip
openshift_manage_node: Label nodes in one pass
-rw-r--r--roles/openshift_manage_node/tasks/config.yml20
1 files changed, 6 insertions, 14 deletions
diff --git a/roles/openshift_manage_node/tasks/config.yml b/roles/openshift_manage_node/tasks/config.yml
index 300f19cbd..4f00351b5 100644
--- a/roles/openshift_manage_node/tasks/config.yml
+++ b/roles/openshift_manage_node/tasks/config.yml
@@ -15,21 +15,13 @@
name: "{{ openshift.node.nodename }}"
kind: node
state: add
- labels: "{{ openshift_node_labels | lib_utils_oo_dict_to_list_of_dict }}"
+ labels: "{{ l_all_labels | lib_utils_oo_dict_to_list_of_dict }}"
namespace: default
when:
- "'nodename' in openshift.node"
- - openshift_node_labels | default({}) != {}
- delegate_to: "{{ openshift_master_host }}"
-
-- name: Label master nodes
- oc_label:
- name: "{{ openshift.node.nodename }}"
- kind: node
- state: add
- labels: "{{ openshift_master_node_labels | lib_utils_oo_dict_to_list_of_dict }}"
- namespace: default
- when:
- - "'nodename' in openshift.node"
- - "'oo_masters_to_config' in group_names"
+ - l_all_labels != {}
delegate_to: "{{ openshift_master_host }}"
+ vars:
+ l_node_labels: "{{ openshift_node_labels | default({}) }}"
+ l_master_labels: "{{ ('oo_masters_to_config' in group_names) | ternary(openshift_master_node_labels, {}) }}"
+ l_all_labels: "{{ l_node_labels | combine(l_master_labels) }}"