From f0b6ddaca76089bd3d02b693176161b9719b4387 Mon Sep 17 00:00:00 2001 From: Michal Petko <2665179+miso231@users.noreply.github.com> Date: Thu, 20 Aug 2020 15:23:30 +0200 Subject: [PATCH] Fix setting node label if kube_override_hostname is defined (#6557) --- roles/kubernetes/node-label/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kubernetes/node-label/tasks/main.yml b/roles/kubernetes/node-label/tasks/main.yml index fc46f1de0ad..152c2d5a9ab 100644 --- a/roles/kubernetes/node-label/tasks/main.yml +++ b/roles/kubernetes/node-label/tasks/main.yml @@ -56,7 +56,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