From 9cdd1dd47ce2356afd5dd66ccc76f5e860f8cfb8 Mon Sep 17 00:00:00 2001 From: Archy <6429715+archy-rock3t-cloud@users.noreply.github.com> Date: Mon, 10 Aug 2026 23:53:20 +0200 Subject: [PATCH] fix: read hostname from ansible_facts in the TLS SAN condition (#548) Signed-off-by: Artem Muterko --- roles/k3s_server/tasks/main.yml | 2 +- roles/k3s_upgrade/tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/k3s_server/tasks/main.yml b/roles/k3s_server/tasks/main.yml index 915d93b..5f473a1 100644 --- a/roles/k3s_server/tasks/main.yml +++ b/roles/k3s_server/tasks/main.yml @@ -48,7 +48,7 @@ - name: Add TLS SAN to config if needed when: - api_endpoint is defined - - api_endpoint != ansible_hostname + - api_endpoint != ansible_facts['hostname'] - not (_api_endpoint_in_config | trim | bool) - not (_api_endpoint_in_args | trim | bool) ansible.builtin.set_fact: diff --git a/roles/k3s_upgrade/tasks/main.yml b/roles/k3s_upgrade/tasks/main.yml index a7c6ed2..a42868d 100644 --- a/roles/k3s_upgrade/tasks/main.yml +++ b/roles/k3s_upgrade/tasks/main.yml @@ -84,7 +84,7 @@ - name: Add TLS SAN to config if needed when: - api_endpoint is defined - - api_endpoint != ansible_hostname + - api_endpoint != ansible_facts['hostname'] - not (_api_endpoint_in_config | trim | bool) - not (_api_endpoint_in_args | trim | bool) ansible.builtin.set_fact: