From e77da0fc675f3b76e6b28d02af60bdd86f8c13c5 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Mon, 26 Aug 2024 21:35:22 +0200 Subject: [PATCH] Fix default value for k3s_node_ip Signed-off-by: Christian Berendt --- all/099-k3s.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/all/099-k3s.yml b/all/099-k3s.yml index 39acecc..0ee7707 100644 --- a/all/099-k3s.yml +++ b/all/099-k3s.yml @@ -17,7 +17,7 @@ systemd_dir: /etc/systemd/system # The IP on which the node is reachable in the cluster. # Here, a sensible default is provided, you can still override # it for each of your hosts, though. -k3s_node_ip: "{{ ansible_facts[k3s_interface]['ipv4']['address'] | default('127.0.0.1') }}" +k3s_node_ip: "{{ hostvars[inventory_hostname]['ansible_' + k3s_interface|default(internal_interface)]['ipv4']['address'] }}" # Disable the taint manually by setting: k3s_master_taint = false k3s_master_taint: "{{ true if groups['k3s_node'] | default([]) | length >= 1 else false }}" @@ -44,7 +44,7 @@ kube_proxy_replacement: true # kube-vip -kube_vip_bgp_routerid: "{{ ansible_facts[k3s_interface]['ipv4']['address'] | default('127.0.0.1') }}" +kube_vip_bgp_routerid: "{{ k3s_node_ip }}" kube_vip_bgp_as: "64513" kube_vip_bgp_peeraddress: "{{ frr_loopback_v4 | default('127.0.0.1') }}" kube_vip_bgp_peeras: "{{ frr_local_as | default('64512') }}"