diff --git a/roles/kubernetes/node-label/tasks/main.yml b/roles/kubernetes/node-label/tasks/main.yml index aa5ffe81555229279deb88876873633b941b26d7..9522d29b54b6dbcede473a1332ee120b137e6e04 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