diff --git a/kubernetes/tasks/prerequisites.yml b/kubernetes/tasks/prerequisites.yml index 2565f85..98060e7 100644 --- a/kubernetes/tasks/prerequisites.yml +++ b/kubernetes/tasks/prerequisites.yml @@ -29,10 +29,14 @@ - import_tasks: ./prerequisites/containerd.yml +- name: Gather interface-name + set_fact: + interface: "{{ kubernetes.ipPool.nodeIp_interface | replace('-', '_') }}" + - name: Getting nodeIp-data from interface set_fact: - nodeip_ipv4: "{{ ansible_facts[ kubernetes.ipPool.nodeIp_interface ].ipv4.address }}" - nodeip_ipv6: "{{ ansible_facts[ kubernetes.ipPool.nodeIp_interface ].ipv6[0].address }}" + nodeip_ipv4: "{{ ansible_facts[ interface ].ipv4.address }}" + nodeip_ipv6: "{{ ansible_facts[ interface ].ipv6[0].address if ansible_facts[ interface ].ipv6 is defined }}" - name: Run handlers to reload configurations meta: flush_handlers