From 12718203ac4b951cf38c9879f7d6b5b2538fa59b Mon Sep 17 00:00:00 2001 From: Nik Afiq Date: Sat, 25 Jul 2026 00:13:22 +0900 Subject: [PATCH] fix: k3s-agent label/taint tasks use undefined ansible_hostname ansible.cfg sets inject_facts_as_vars: False repo-wide (the ollama role already follows this via ansible_facts['system']), but these two tasks referenced the bare ansible_hostname magic var, which doesn't exist under that setting. Surfaced today as a hard failure re-running setup-gpu-node - previously latent since these nodes' labels/taints were already correct from whenever they last applied cleanly. Co-Authored-By: Claude Sonnet 5 --- ansible/roles/k3s-agent/tasks/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/k3s-agent/tasks/main.yaml b/ansible/roles/k3s-agent/tasks/main.yaml index 6971fe7..47bbd4d 100644 --- a/ansible/roles/k3s-agent/tasks/main.yaml +++ b/ansible/roles/k3s-agent/tasks/main.yaml @@ -24,7 +24,7 @@ - name: Apply node labels ansible.builtin.shell: cmd: > - k3s kubectl label node {{ ansible_hostname }} + k3s kubectl label node {{ ansible_facts['hostname'] }} {{ item.key }}={{ item.value }} --overwrite loop: "{{ k3s_node_labels | dict2items }}" delegate_to: minisforum @@ -35,7 +35,7 @@ - name: Apply node taints ansible.builtin.shell: cmd: > - k3s kubectl taint node {{ ansible_hostname }} + k3s kubectl taint node {{ ansible_facts['hostname'] }} {{ item }} --overwrite loop: "{{ k3s_node_taints }}" delegate_to: minisforum