Browse Source

Merge "simple-init: allow for NetworkManager support"

tags/2.19.0^0
Zuul 5 months ago
parent
commit
8d3fa3a85c

+ 10
- 0
diskimage_builder/elements/simple-init/README.rst View File

@@ -58,3 +58,13 @@ Then set your DIB env vars like this before running DIB::
58 58
   DIB_INSTALLTYPE_simple_init=repo
59 59
   DIB_REPOLOCATION_glean=/tmp/glean
60 60
   DIB_REPOREF_glean=my-test-ref
61
+
62
+NetworkManager
63
+--------------
64
+
65
+By default, this uses the "legacy" scripts on each platform.  To use
66
+NetworkManager instead, set ``DIB_SIMPLE_INIT_NETWORKMANAGER`` to
67
+non-zero.  See the glean documentation for what the implications for
68
+this are on each platform.
69
+
70
+This is currently only implemented for CentOS and Fedora platforms.

+ 1
- 0
diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager View File

@@ -0,0 +1 @@
1
+export DIB_SIMPLE_INIT_NETWORKMANAGER=${DIB_SIMPLE_INIT_NETWORKMANAGER:-0}

+ 6
- 1
diskimage_builder/elements/simple-init/install.d/50-simple-init View File

@@ -24,4 +24,9 @@ SCRIPTDIR=$(dirname $0)
24 24
 # Ensure the 8021q module is loaded so that glean can support tagged interfaces
25 25
 echo "8021q" >> /etc/modules
26 26
 
27
-glean-install
27
+enable_nm=""
28
+if [[ ${DIB_SIMPLE_INIT_NETWORKMANAGER} != 0 ]]; then
29
+    enable_nm="--use-nm"
30
+fi
31
+
32
+glean-install ${enable_nm}

+ 4
- 0
diskimage_builder/elements/simple-init/package-installs.yaml View File

@@ -1,3 +1,7 @@
1 1
 dhcp-client:
2 2
 net-tools:
3 3
 ifupdown:
4
+network-scripts:
5
+  when: DIB_SIMPLE_INIT_NETWORKMANAGER = 0
6
+NetworkManager:
7
+  when: DIB_SIMPLE_INIT_NETWORKMANAGER != 0

+ 11
- 2
diskimage_builder/elements/simple-init/pkg-map View File

@@ -5,7 +5,8 @@
5 5
     },
6 6
     "debian": {
7 7
       "dhcp-client": "isc-dhcp-client",
8
-      "ifupdown": "ifupdown"
8
+      "ifupdown": "ifupdown",
9
+      "NetworkManager": "network-manager"
9 10
     },
10 11
     "gentoo": {
11 12
       "dhcp-client": "net-misc/dhcp",
@@ -16,8 +17,16 @@
16 17
       "dhcp-client": "dhcp-client"
17 18
     }
18 19
   },
20
+  "release": {
21
+    "fedora": {
22
+      "29": {
23
+        "network-scripts": "network-scripts"
24
+      }
25
+    }
26
+  },
19 27
   "default": {
20 28
     "dhcp-client": "isc-dhcp-client",
21
-    "ifupdown": ""
29
+    "ifupdown": "",
30
+    "network-scripts": ""
22 31
   }
23 32
 }

+ 5
- 3
diskimage_builder/elements/simple-init/post-install.d/80-simple-init View File

@@ -13,9 +13,11 @@ case "$DIB_INIT_SYSTEM" in
13 13
         ;;
14 14
     systemd)
15 15
         if [[ ${DISTRO_NAME} =~ (centos|rhel7|fedora) ]]; then
16
-            # NOTE(pabelanger): Glean requires network.service for
17
-            # these platforms.
18
-            systemctl enable network.service
16
+            if [[ ${DIB_SIMPLE_INIT_NETWORKMANAGER} != 1 ]]; then
17
+                # NOTE(pabelanger): Glean requires network.service for
18
+                # these platforms when not using networkmanager
19
+                systemctl enable network.service
20
+            fi
19 21
         elif [[ ${DISTRO_NAME} =~ (opensuse) ]]; then
20 22
             # on suse, this is named wicked.service, but it's the same
21 23
             # as network.service.

+ 5
- 0
releasenotes/notes/simple-init-nm-f0896124dee92a03.yaml View File

@@ -0,0 +1,5 @@
1
+---
2
+features:
3
+  - |
4
+    The `simple-init` element can now use NetworkManager instead of
5
+    legacy scripts on Red Hat platforms.

Loading…
Cancel
Save