diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-01-25 00:31:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-25 00:31:42 -0800 |
commit | bf863c250ee92b9fea3d9cfa4040e5ecdbba4479 (patch) | |
tree | 4598d8a2c1a82195b8a08ab902fd9a0e9e3fbfaf /roles | |
parent | 2487fa87fc198bffb61052c5e51da8c618dc939e (diff) | |
parent | 4e2272db05cf00335701aa6db5ecfd9195623d35 (diff) | |
download | openshift-bf863c250ee92b9fea3d9cfa4040e5ecdbba4479.tar.gz openshift-bf863c250ee92b9fea3d9cfa4040e5ecdbba4479.tar.bz2 openshift-bf863c250ee92b9fea3d9cfa4040e5ecdbba4479.tar.xz openshift-bf863c250ee92b9fea3d9cfa4040e5ecdbba4479.zip |
Merge pull request #6849 from vrutkovs/label-masters-with-upstream-standard
Automatic merge from submit-queue.
Label masters with node-role.kubernetes.io/master
This is controlled by `openshift_master_node_label` var in openshift_manage_node
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1535673
Diffstat (limited to 'roles')
-rw-r--r-- | roles/openshift_manage_node/defaults/main.yml | 3 | ||||
-rw-r--r-- | roles/openshift_manage_node/tasks/config.yml | 27 | ||||
-rw-r--r-- | roles/openshift_manage_node/tasks/main.yml | 23 |
3 files changed, 31 insertions, 22 deletions
diff --git a/roles/openshift_manage_node/defaults/main.yml b/roles/openshift_manage_node/defaults/main.yml index f0e728a3f..00e04b9f2 100644 --- a/roles/openshift_manage_node/defaults/main.yml +++ b/roles/openshift_manage_node/defaults/main.yml @@ -4,3 +4,6 @@ openshift_manage_node_is_master: False # Default is to be schedulable except for master nodes. l_openshift_manage_schedulable: "{{ openshift_schedulable | default(not openshift_manage_node_is_master) }}" + +openshift_master_node_labels: + node-role.kubernetes.io/master: 'true' diff --git a/roles/openshift_manage_node/tasks/config.yml b/roles/openshift_manage_node/tasks/config.yml new file mode 100644 index 000000000..4f00351b5 --- /dev/null +++ b/roles/openshift_manage_node/tasks/config.yml @@ -0,0 +1,27 @@ +--- +- name: Set node schedulability + oc_adm_manage_node: + node: "{{ openshift.node.nodename | lower }}" + schedulable: "{{ 'true' if l_openshift_manage_schedulable | bool else 'false' }}" + retries: 10 + delay: 5 + register: node_schedulable + until: node_schedulable is succeeded + when: "'nodename' in openshift.node" + delegate_to: "{{ openshift_master_host }}" + +- name: Label nodes + oc_label: + name: "{{ openshift.node.nodename }}" + kind: node + state: add + labels: "{{ l_all_labels | lib_utils_oo_dict_to_list_of_dict }}" + namespace: default + when: + - "'nodename' in openshift.node" + - 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) }}" diff --git a/roles/openshift_manage_node/tasks/main.yml b/roles/openshift_manage_node/tasks/main.yml index 9251d380b..154e2b45f 100644 --- a/roles/openshift_manage_node/tasks/main.yml +++ b/roles/openshift_manage_node/tasks/main.yml @@ -34,25 +34,4 @@ when: "'nodename' in openshift.node" delegate_to: "{{ openshift_master_host }}" -- name: Set node schedulability - oc_adm_manage_node: - node: "{{ openshift.node.nodename | lower }}" - schedulable: "{{ 'true' if l_openshift_manage_schedulable | bool else 'false' }}" - retries: 10 - delay: 5 - register: node_schedulable - until: node_schedulable is succeeded - when: "'nodename' in openshift.node" - delegate_to: "{{ openshift_master_host }}" - -- name: Label nodes - oc_label: - name: "{{ openshift.node.nodename }}" - kind: node - state: add - labels: "{{ openshift_node_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 }}" +- include_tasks: config.yml |