Skip to content

Commit

Permalink
Fix node registration ip on dual stack (#230)
Browse files Browse the repository at this point in the history
When using a user defined node ip on a dual stack cluster,
k3s_node_ip will contain "ipv4,ipv6" IP. In order to properly set
the registration IP, the first (preferred) IP in the list is used,
and if it is the IPv6 IP it will be URL wrapped.
  • Loading branch information
logan2211 authored Jan 11, 2025
1 parent 6ff6780 commit 9247de3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasks/ensure_pre_configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@

- name: Ensure the node registration address is defined from node-ip
ansible.builtin.set_fact:
k3s_registration_address: "{{ hostvars[k3s_control_delegate].k3s_node_ip }}"
k3s_registration_address: "{{ (hostvars[k3s_control_delegate].k3s_node_ip | split(','))[0] | ipwrap }}"
check_mode: false
when:
- k3s_registration_address is not defined
Expand Down

0 comments on commit 9247de3

Please sign in to comment.