mirror of
https://github.com/PyratLabs/ansible-role-k3s.git
synced 2024-11-29 12:55:51 +01:00
Fix node registration ip on dual stack
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.
This commit is contained in:
parent
6ff67804dd
commit
a6c49dac0c
@ -147,7 +147,7 @@
|
|||||||
|
|
||||||
- name: Ensure the node registration address is defined from node-ip
|
- name: Ensure the node registration address is defined from node-ip
|
||||||
ansible.builtin.set_fact:
|
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
|
check_mode: false
|
||||||
when:
|
when:
|
||||||
- k3s_registration_address is not defined
|
- k3s_registration_address is not defined
|
||||||
|
Loading…
Reference in New Issue
Block a user