Clear net.ifnames definition

With RHEL8, net.ifnames is set to 0 in the grub config. This is a change
in the default image which can have user impacts. We want to clear it to
go back to the previously defined behavior in RHEL7.

Change-Id: I621066ea5e0e934668ff4c91e991a95d18e019f7
Closes-Bug: #1841441
(cherry picked from commit 8da8d9a51b)
This commit is contained in:
Alex Schultz 2019-08-26 08:49:44 -06:00 committed by Emilien Macchi
parent 84659474d5
commit 1ebd7afac1
3 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,7 @@
interface-names
===============
net.ifnames may be 0 in /etc/default/grub which can make generating a
configuration for the network interfaces difficult. The default in RHEL7
was to not have this defined. The kernel args can be tuned later in the
deployment so we want to clean it out if it is defined in grub.

View File

@ -0,0 +1,10 @@
#!/bin/bash
set -eux
set -o pipefail
if [ -f /etc/default/grub ]; then
# net.ifacenames is defined and set to 0 starting with RHEL8.
# This is a change from RHEL7 which can affect network configurations.
sed -i 's/net.ifnames=0//g' /etc/default/grub
fi

View File

@ -3,3 +3,4 @@ os-refresh-config
package-installs
pip-manifest
openvswitch
interface-names