Check and remove existing image interface configurations

This change will remove any existing interface configurations in the image. They are not necessary
and could interrupt with deployments. In any case they should not exist if we use 
dhcp-all-interfaces element.

Change-Id: I35a4b5ea6e2315de3b0d9f8353ac2b6f4b995697
This commit is contained in:
Noam Angel 2021-02-16 08:29:42 +00:00
parent cbbcf377d8
commit 0e700b25dc

View File

@ -6,17 +6,16 @@ fi
set -eu
set -o pipefail
# Cloud images may hard code the eth0 interfaces so they
# Cloud images may hard code interfaces so they
# boot with DHCP.
# Fedora
rm -f /etc/sysconfig/network-scripts/ifcfg-eth*
# RHEL/CentOS/Fedora
for ifcfg in $(ls /etc/sysconfig/network-scripts/ifcfg-* | grep -v "ifcfg-lo"); do
rm -f $ifcfg
done
# Ubuntu
rm -f /etc/network/interfaces.d/eth*.cfg
# Debian
rm -f /etc/network/interfaces.d/eth*
# Ubuntu/Debian
rm -f /etc/network/interfaces.d/*
# Gentoo
rm -f /etc/conf.d/net*