diff --git a/roles/kubernetes/node-label/tasks/main.yml b/roles/kubernetes/node-label/tasks/main.yml index aa5ffe815..9522d29b5 100644 --- a/roles/kubernetes/node-label/tasks/main.yml +++ b/roles/kubernetes/node-label/tasks/main.yml @@ -40,7 +40,7 @@ - name: Set label to node command: >- - {{ bin_dir }}/kubectl label node {{ inventory_hostname }} {{ item }} --overwrite=true + {{ bin_dir }}/kubectl label node {{ kube_override_hostname | default(inventory_hostname) }} {{ item }} --overwrite=true loop: "{{ role_node_labels + inventory_node_labels }}" delegate_to: "{{ groups['kube-master'][0] }}" changed_when: false