Browse Source

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)
tags/10.4.2^0
Alex Schultz 1 month ago
parent
commit
1ebd7afac1

+ 7
- 0
elements/interface-names/README.md View File

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

+ 10
- 0
elements/interface-names/install.d/70-clear-net-ifnames View File

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

+ 1
- 0
elements/os-net-config/element-deps View File

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

Loading…
Cancel
Save