|
@@ -1,48 +0,0 @@
|
|
|
----
|
|
|
-
|
|
|
-- delegate_to: '{{ openshift_master_host }}'
|
|
|
- run_once: true
|
|
|
- block:
|
|
|
- - name: Retrieve nodes that are marked with the infra selector or the legacy infra selector
|
|
|
- oc_obj:
|
|
|
- state: list
|
|
|
- kind: Node
|
|
|
- selector: '{{ openshift_hosted_infra_selector | default("region=infra") }}'
|
|
|
- register: infra_nodes_by_selector
|
|
|
-
|
|
|
- - name: Label infra or legacy infra nodes with the new role label
|
|
|
- oc_label:
|
|
|
- name: '{{ item }}'
|
|
|
- kind: node
|
|
|
- state: add
|
|
|
- labels:
|
|
|
- - key: node-role.kubernetes.io/infra
|
|
|
- value: 'true'
|
|
|
- with_items: "{{ infra_nodes_by_selector.results.results.0['items'] | map(attribute='metadata') | map(attribute='name') | list }}"
|
|
|
-
|
|
|
- - name: Retrieve non-infra, non-master nodes that are not yet labeled compute
|
|
|
- oc_obj:
|
|
|
- state: list
|
|
|
- kind: Node
|
|
|
- selector: '{{ (openshift_hosted_infra_selector | default("node-role.kubernetes.io/infra=true")) | regex_replace("=", "!=") }},node-role.kubernetes.io/infra!=true,node-role.kubernetes.io/master!=true,node-role.kubernetes.io/compute!=true'
|
|
|
- register: non_master_non_infra_nodes_result
|
|
|
-
|
|
|
- - name: label non-master non-infra nodes compute
|
|
|
- oc_label:
|
|
|
- name: '{{ item }}'
|
|
|
- kind: node
|
|
|
- state: add
|
|
|
- labels:
|
|
|
- - key: node-role.kubernetes.io/compute
|
|
|
- value: 'true'
|
|
|
- with_items: "{{ non_master_non_infra_nodes_result.results.results.0['items'] | map(attribute='metadata') | map(attribute='name') | list }}"
|
|
|
-
|
|
|
- - name: Label all-in-one master as a compute node
|
|
|
- oc_label:
|
|
|
- name: '{{ openshift.node.nodename }}'
|
|
|
- kind: node
|
|
|
- state: add
|
|
|
- labels:
|
|
|
- - key: node-role.kubernetes.io/compute
|
|
|
- value: 'true'
|
|
|
- when: groups['oo_nodes_to_config'] | default([]) | union(groups['oo_nodes_to_bootstrap'] | default([])) | union(groups['oo_masters_to_config']) | length == 1
|