From dfcfbc1f3fd6e1ce19909f0d9c863f9ae430f948 Mon Sep 17 00:00:00 2001 From: Timothy Stewart Date: Sat, 1 Aug 2026 15:41:01 -0500 Subject: [PATCH] fix(molecule): select distro-specific private interfaces - Use eth1 for Ubuntu and Debian Bento guests when present. - Keep enp0s8 for Rocky Linux guests and other images. - Apply the selection consistently across all Molecule scenarios. --- molecule/calico/overrides.yml | 4 ++-- molecule/cilium/overrides.yml | 4 ++-- molecule/default/overrides.yml | 4 ++-- molecule/ipv6/overrides.yml | 4 ++-- molecule/kube-vip/overrides.yml | 4 ++-- molecule/single_node/overrides.yml | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/molecule/calico/overrides.yml b/molecule/calico/overrides.yml index 0b27e47..4f56890 100644 --- a/molecule/calico/overrides.yml +++ b/molecule/calico/overrides.yml @@ -6,8 +6,8 @@ ansible.builtin.set_fact: # See: # https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant - calico_iface: enp0s8 - kube_vip_iface: enp0s8 + calico_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" + kube_vip_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" # The test VMs might be a bit slow, so we give them more time to join the cluster: retry_count: 45 diff --git a/molecule/cilium/overrides.yml b/molecule/cilium/overrides.yml index 22fdf9d..9ef8a57 100644 --- a/molecule/cilium/overrides.yml +++ b/molecule/cilium/overrides.yml @@ -6,8 +6,8 @@ ansible.builtin.set_fact: # See: # https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant - cilium_iface: enp0s8 - kube_vip_iface: enp0s8 + cilium_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" + kube_vip_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" # The test VMs might be a bit slow, so we give them more time to join the cluster: retry_count: 45 diff --git a/molecule/default/overrides.yml b/molecule/default/overrides.yml index f7484e4..77cb73e 100644 --- a/molecule/default/overrides.yml +++ b/molecule/default/overrides.yml @@ -6,10 +6,10 @@ ansible.builtin.set_fact: # See: # https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant - flannel_iface: enp0s8 + flannel_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" # kube-vip cannot infer the cluster interface in these multi-NIC # Vagrant guests because the default route is on eth0. - kube_vip_iface: enp0s8 + kube_vip_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" # The test VMs might be a bit slow, so we give them more time to join the cluster: retry_count: 45 diff --git a/molecule/ipv6/overrides.yml b/molecule/ipv6/overrides.yml index 3e9aa31..a73333b 100644 --- a/molecule/ipv6/overrides.yml +++ b/molecule/ipv6/overrides.yml @@ -6,12 +6,12 @@ ansible.builtin.set_fact: # See: # https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant - flannel_iface: enp0s8 + flannel_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" # In this scenario, we have multiple interfaces that the VIP could be # broadcasted on. Since we have assigned a dedicated private network # here, let's make sure that it is used. - kube_vip_iface: enp0s8 + kube_vip_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" # The test VMs might be a bit slow, so we give them more time to join the cluster: retry_count: 45 diff --git a/molecule/kube-vip/overrides.yml b/molecule/kube-vip/overrides.yml index 1190801..cdfa090 100644 --- a/molecule/kube-vip/overrides.yml +++ b/molecule/kube-vip/overrides.yml @@ -6,8 +6,8 @@ ansible.builtin.set_fact: # See: # https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant - flannel_iface: enp0s8 - kube_vip_iface: enp0s8 + flannel_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" + kube_vip_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" # The test VMs might be a bit slow, so we give them more time to join the cluster: retry_count: 45 diff --git a/molecule/single_node/overrides.yml b/molecule/single_node/overrides.yml index fe6bbfd..17857be 100644 --- a/molecule/single_node/overrides.yml +++ b/molecule/single_node/overrides.yml @@ -6,8 +6,8 @@ ansible.builtin.set_fact: # See: # https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant - flannel_iface: enp0s8 - kube_vip_iface: enp0s8 + flannel_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" + kube_vip_iface: "{{ 'eth1' if 'eth1' in ansible_facts.interfaces else 'enp0s8' }}" # The test VMs might be a bit slow, so we give them more time to join the cluster: retry_count: 45