fix: k3s-agent label/taint tasks use undefined ansible_hostname
Some checks failed
validate / lint (push) Failing after 1s

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 <noreply@anthropic.com>
This commit is contained in:
Nik Afiq 2026-07-25 00:13:22 +09:00
parent 69d880186a
commit 12718203ac

View File

@ -24,7 +24,7 @@
- name: Apply node labels - name: Apply node labels
ansible.builtin.shell: ansible.builtin.shell:
cmd: > cmd: >
k3s kubectl label node {{ ansible_hostname }} k3s kubectl label node {{ ansible_facts['hostname'] }}
{{ item.key }}={{ item.value }} --overwrite {{ item.key }}={{ item.value }} --overwrite
loop: "{{ k3s_node_labels | dict2items }}" loop: "{{ k3s_node_labels | dict2items }}"
delegate_to: minisforum delegate_to: minisforum
@ -35,7 +35,7 @@
- name: Apply node taints - name: Apply node taints
ansible.builtin.shell: ansible.builtin.shell:
cmd: > cmd: >
k3s kubectl taint node {{ ansible_hostname }} k3s kubectl taint node {{ ansible_facts['hostname'] }}
{{ item }} --overwrite {{ item }} --overwrite
loop: "{{ k3s_node_taints }}" loop: "{{ k3s_node_taints }}"
delegate_to: minisforum delegate_to: minisforum