From 98ecdc745465eafa7fe1b4059b294fd744ff7c91 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 9 Aug 2024 12:00:58 -0400 Subject: [PATCH] ansible: netplan: fixed host netif by mac address Since we track the bookworm-backports kernel on the CI amd64 hosts, the name of the network interfaces may change after a kernel update. Change the netplan config to bind the interface based on its mac address which doesn't change. Change-Id: I7c2a040964f22187fb6a76e1ec3cd1b6e05a2679 Signed-off-by: Michael Jeanson --- .../host_vars/ci-host-amd64-1a.internal.efficios.com.yml | 7 +++++-- .../host_vars/ci-host-amd64-1b.internal.efficios.com.yml | 7 +++++-- .../host_vars/ci-host-amd64-1c.internal.efficios.com.yml | 7 +++++-- .../host_vars/ci-host-amd64-1d.internal.efficios.com.yml | 7 +++++-- .../host_vars/ci-host-amd64-2a.internal.efficios.com.yml | 7 +++++-- .../host_vars/ci-host-amd64-2b.internal.efficios.com.yml | 7 +++++-- .../host_vars/ci-host-amd64-2c.internal.efficios.com.yml | 7 +++++-- .../host_vars/ci-host-amd64-2d.internal.efficios.com.yml | 7 +++++-- 8 files changed, 40 insertions(+), 16 deletions(-) diff --git a/automation/ansible/host_vars/ci-host-amd64-1a.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-1a.internal.efficios.com.yml index b74955d..3f2c675 100644 --- a/automation/ansible/host_vars/ci-host-amd64-1a.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-1a.internal.efficios.com.yml @@ -14,12 +14,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0np0: + eth0: + match: + macaddress: 7c:c2:55:9f:17:fe + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0np0 + - eth0 accept-ra: false addresses: - 172.18.0.190/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-1b.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-1b.internal.efficios.com.yml index ba6eb34..dba1af7 100644 --- a/automation/ansible/host_vars/ci-host-amd64-1b.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-1b.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0np0: + eth0: + match: + macaddress: 7c:c2:55:9f:18:60 + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0np0 + - eth0 accept-ra: false addresses: - 172.18.0.191/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-1c.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-1c.internal.efficios.com.yml index b30b900..86b5917 100644 --- a/automation/ansible/host_vars/ci-host-amd64-1c.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-1c.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0np0: + eth0: + match: + macaddress: 7c:c2:55:9f:18:7e + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0np0 + - eth0 accept-ra: false addresses: - 172.18.0.192/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-1d.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-1d.internal.efficios.com.yml index 239c4ce..f4f8879 100644 --- a/automation/ansible/host_vars/ci-host-amd64-1d.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-1d.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0np0: + eth0: + match: + macaddress: 7c:c2:55:9f:17:e6 + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0np0 + - eth0 accept-ra: false addresses: - 172.18.0.193/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-2a.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-2a.internal.efficios.com.yml index 9e70482..efbdcb5 100644 --- a/automation/ansible/host_vars/ci-host-amd64-2a.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-2a.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0np0: + eth0: + match: + macaddress: 7c:c2:55:9f:17:e8 + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0np0 + - eth0 accept-ra: false addresses: - 172.18.0.194/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-2b.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-2b.internal.efficios.com.yml index ef292cf..ee01306 100644 --- a/automation/ansible/host_vars/ci-host-amd64-2b.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-2b.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0np0: + eth0: + match: + macaddress: 7c:c2:55:9f:17:e0 + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0np0 + - eth0 accept-ra: false addresses: - 172.18.0.195/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-2c.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-2c.internal.efficios.com.yml index 2148b0f..396a387 100644 --- a/automation/ansible/host_vars/ci-host-amd64-2c.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-2c.internal.efficios.com.yml @@ -15,12 +15,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0np0: + eth0: + match: + macaddress: 7c:c2:55:9f:18:5e + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0np0 + - eth0 accept-ra: false addresses: - 172.18.0.196/16 diff --git a/automation/ansible/host_vars/ci-host-amd64-2d.internal.efficios.com.yml b/automation/ansible/host_vars/ci-host-amd64-2d.internal.efficios.com.yml index 07ba3f2..d3ea373 100644 --- a/automation/ansible/host_vars/ci-host-amd64-2d.internal.efficios.com.yml +++ b/automation/ansible/host_vars/ci-host-amd64-2d.internal.efficios.com.yml @@ -18,12 +18,15 @@ netplan_content: | version: 2 renderer: networkd ethernets: - enp5s0f0np0: + eth0: + match: + macaddress: 7c:c2:55:9f:17:ea + set-name: eth0 dhcp4: no bridges: br102: interfaces: - - enp5s0f0np0 + - eth0 accept-ra: false addresses: - 172.18.0.197/16 -- 2.34.1