Browse Source

Label all-in-one cluster as compute=true

Vadim Rutkovsky 7 years ago
parent
commit
953a3779ba
1 changed files with 10 additions and 0 deletions
  1. 10 0
      roles/openshift_manage_node/tasks/set_default_node_role.yml

+ 10 - 0
roles/openshift_manage_node/tasks/set_default_node_role.yml

@@ -36,3 +36,13 @@
           - 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