summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-09 03:38:25 +0000
committerGerrit Code Review <review@openstack.org>2019-01-09 03:38:25 +0000
commit8d3fa3a85c1be9881d3c24b8ea879bbbfad1934e (patch)
tree0db5782bb2bf2c1875fe793ab53de91c3f419400
parent18c0c42c8d47a97e8796bbde6b49fbabacaae38e (diff)
parent8ec3750dda4d5824f4f018709c53eb231ea7124f (diff)
Merge "simple-init: allow for NetworkManager support"2.19.0
-rw-r--r--diskimage_builder/elements/simple-init/README.rst10
-rw-r--r--diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager1
-rwxr-xr-xdiskimage_builder/elements/simple-init/install.d/50-simple-init7
-rw-r--r--diskimage_builder/elements/simple-init/package-installs.yaml4
-rw-r--r--diskimage_builder/elements/simple-init/pkg-map13
-rwxr-xr-xdiskimage_builder/elements/simple-init/post-install.d/80-simple-init8
-rw-r--r--releasenotes/notes/simple-init-nm-f0896124dee92a03.yaml5
7 files changed, 42 insertions, 6 deletions
diff --git a/diskimage_builder/elements/simple-init/README.rst b/diskimage_builder/elements/simple-init/README.rst
index dd131d9..ad8dfc5 100644
--- a/diskimage_builder/elements/simple-init/README.rst
+++ b/diskimage_builder/elements/simple-init/README.rst
@@ -58,3 +58,13 @@ Then set your DIB env vars like this before running DIB::
58 DIB_INSTALLTYPE_simple_init=repo 58 DIB_INSTALLTYPE_simple_init=repo
59 DIB_REPOLOCATION_glean=/tmp/glean 59 DIB_REPOLOCATION_glean=/tmp/glean
60 DIB_REPOREF_glean=my-test-ref 60 DIB_REPOREF_glean=my-test-ref
61
62NetworkManager
63--------------
64
65By default, this uses the "legacy" scripts on each platform. To use
66NetworkManager instead, set ``DIB_SIMPLE_INIT_NETWORKMANAGER`` to
67non-zero. See the glean documentation for what the implications for
68this are on each platform.
69
70This is currently only implemented for CentOS and Fedora platforms.
diff --git a/diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager b/diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager
new file mode 100644
index 0000000..3aaeaa7
--- /dev/null
+++ b/diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager
@@ -0,0 +1 @@
export DIB_SIMPLE_INIT_NETWORKMANAGER=${DIB_SIMPLE_INIT_NETWORKMANAGER:-0}
diff --git a/diskimage_builder/elements/simple-init/install.d/50-simple-init b/diskimage_builder/elements/simple-init/install.d/50-simple-init
index 8e89296..cae36b8 100755
--- a/diskimage_builder/elements/simple-init/install.d/50-simple-init
+++ b/diskimage_builder/elements/simple-init/install.d/50-simple-init
@@ -24,4 +24,9 @@ SCRIPTDIR=$(dirname $0)
24# Ensure the 8021q module is loaded so that glean can support tagged interfaces 24# Ensure the 8021q module is loaded so that glean can support tagged interfaces
25echo "8021q" >> /etc/modules 25echo "8021q" >> /etc/modules
26 26
27glean-install 27enable_nm=""
28if [[ ${DIB_SIMPLE_INIT_NETWORKMANAGER} != 0 ]]; then
29 enable_nm="--use-nm"
30fi
31
32glean-install ${enable_nm}
diff --git a/diskimage_builder/elements/simple-init/package-installs.yaml b/diskimage_builder/elements/simple-init/package-installs.yaml
index 8690364..ad868c0 100644
--- a/diskimage_builder/elements/simple-init/package-installs.yaml
+++ b/diskimage_builder/elements/simple-init/package-installs.yaml
@@ -1,3 +1,7 @@
1dhcp-client: 1dhcp-client:
2net-tools: 2net-tools:
3ifupdown: 3ifupdown:
4network-scripts:
5 when: DIB_SIMPLE_INIT_NETWORKMANAGER = 0
6NetworkManager:
7 when: DIB_SIMPLE_INIT_NETWORKMANAGER != 0
diff --git a/diskimage_builder/elements/simple-init/pkg-map b/diskimage_builder/elements/simple-init/pkg-map
index 906ca12..b42f33c 100644
--- a/diskimage_builder/elements/simple-init/pkg-map
+++ b/diskimage_builder/elements/simple-init/pkg-map
@@ -5,7 +5,8 @@
5 }, 5 },
6 "debian": { 6 "debian": {
7 "dhcp-client": "isc-dhcp-client", 7 "dhcp-client": "isc-dhcp-client",
8 "ifupdown": "ifupdown" 8 "ifupdown": "ifupdown",
9 "NetworkManager": "network-manager"
9 }, 10 },
10 "gentoo": { 11 "gentoo": {
11 "dhcp-client": "net-misc/dhcp", 12 "dhcp-client": "net-misc/dhcp",
@@ -16,8 +17,16 @@
16 "dhcp-client": "dhcp-client" 17 "dhcp-client": "dhcp-client"
17 } 18 }
18 }, 19 },
20 "release": {
21 "fedora": {
22 "29": {
23 "network-scripts": "network-scripts"
24 }
25 }
26 },
19 "default": { 27 "default": {
20 "dhcp-client": "isc-dhcp-client", 28 "dhcp-client": "isc-dhcp-client",
21 "ifupdown": "" 29 "ifupdown": "",
30 "network-scripts": ""
22 } 31 }
23} 32}
diff --git a/diskimage_builder/elements/simple-init/post-install.d/80-simple-init b/diskimage_builder/elements/simple-init/post-install.d/80-simple-init
index 898dd41..4c5a79a 100755
--- a/diskimage_builder/elements/simple-init/post-install.d/80-simple-init
+++ b/diskimage_builder/elements/simple-init/post-install.d/80-simple-init
@@ -13,9 +13,11 @@ case "$DIB_INIT_SYSTEM" in
13 ;; 13 ;;
14 systemd) 14 systemd)
15 if [[ ${DISTRO_NAME} =~ (centos|rhel7|fedora) ]]; then 15 if [[ ${DISTRO_NAME} =~ (centos|rhel7|fedora) ]]; then
16 # NOTE(pabelanger): Glean requires network.service for 16 if [[ ${DIB_SIMPLE_INIT_NETWORKMANAGER} != 1 ]]; then
17 # these platforms. 17 # NOTE(pabelanger): Glean requires network.service for
18 systemctl enable network.service 18 # these platforms when not using networkmanager
19 systemctl enable network.service
20 fi
19 elif [[ ${DISTRO_NAME} =~ (opensuse) ]]; then 21 elif [[ ${DISTRO_NAME} =~ (opensuse) ]]; then
20 # on suse, this is named wicked.service, but it's the same 22 # on suse, this is named wicked.service, but it's the same
21 # as network.service. 23 # as network.service.
diff --git a/releasenotes/notes/simple-init-nm-f0896124dee92a03.yaml b/releasenotes/notes/simple-init-nm-f0896124dee92a03.yaml
new file mode 100644
index 0000000..1fb86e7
--- /dev/null
+++ b/releasenotes/notes/simple-init-nm-f0896124dee92a03.yaml
@@ -0,0 +1,5 @@
1---
2features:
3 - |
4 The `simple-init` element can now use NetworkManager instead of
5 legacy scripts on Red Hat platforms.