diff --git a/.zuul.d/jobs.yaml b/.zuul.d/jobs.yaml index 4db297fb..fd743b44 100644 --- a/.zuul.d/jobs.yaml +++ b/.zuul.d/jobs.yaml @@ -223,8 +223,6 @@ base_element: centos-minimal release: '7' mirror: "http://{{ zuul_site_mirror_fqdn }}/centos" - env-vars: - DIB_SIMPLE_INIT_NETWORKMANAGER: '1' - job: name: dib-nodepool-functional-openstack-fedora-29-src @@ -238,8 +236,6 @@ nodepool_diskimage: base_element: fedora-minimal release: '29' - env-vars: - DIB_SIMPLE_INIT_NETWORKMANAGER: '1' - job: name: dib-nodepool-functional-openstack-fedora-30-src @@ -253,8 +249,6 @@ nodepool_diskimage: base_element: fedora-minimal release: '30' - env-vars: - DIB_SIMPLE_INIT_NETWORKMANAGER: '1' - job: name: dib-nodepool-functional-openstack-ubuntu-trusty-src 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 index 3aaeaa76..9dc41c1e 100644 --- a/diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager +++ b/diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager @@ -1 +1,12 @@ -export DIB_SIMPLE_INIT_NETWORKMANAGER=${DIB_SIMPLE_INIT_NETWORKMANAGER:-0} +if [[ ${DISTRO_NAME} =~ (centos|fedora) ]]; then + export DIB_SIMPLE_INIT_NETWORKMANAGER=${DIB_SIMPLE_INIT_NETWORKMANAGER:-1} +else + export DIB_SIMPLE_INIT_NETWORKMANAGER=${DIB_SIMPLE_INIT_NETWORKMANAGER:-0} +fi + +if [[ ${DISTRO_NAME} == "centos" && $DIB_RELEASE -ge 8 ]] || [[ ${DISTRO_NAME} == "fedora" ]]; then + if [[ $DIB_SIMPLE_INIT_NETWORKMANAGER == 0 ]]; then + echo "simple-init only supports NetworkManager mode on Fedora and CentOS 8" + exit 1 + fi +fi 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 5fcdc7ad..3acfba3e 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 @@ -12,7 +12,7 @@ case "$DIB_INIT_SYSTEM" in exit 0 ;; systemd) - if [[ ${DISTRO_NAME} =~ (centos|rhel7|fedora) ]]; then + if [[ ${DISTRO_NAME} == centos && ${DIB_RELEASE} -eq 7 ]]; then if [[ ${DIB_SIMPLE_INIT_NETWORKMANAGER} != 1 ]]; then # NOTE(pabelanger): Glean requires network.service for # these platforms when not using networkmanager @@ -22,6 +22,10 @@ case "$DIB_INIT_SYSTEM" in # on suse, this is named wicked.service, but it's the same # as network.service. systemctl enable wicked.service + else + # NOTE(ianw): it might be better to whitelist platforms in + # the future, but for now assume it will "just work" + continue fi ;; openrc) diff --git a/releasenotes/notes/simple-init-nm-5d19e249c0a4560b.yaml b/releasenotes/notes/simple-init-nm-5d19e249c0a4560b.yaml new file mode 100644 index 00000000..bcc7cb6c --- /dev/null +++ b/releasenotes/notes/simple-init-nm-5d19e249c0a4560b.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + The ``simple-init`` element will now default to using NetworkManager + for CentOS and Fedora platforms. For CentOS 8 and Fedora, the + ``DIB_SIMPLE_INIT_NETWORKMANAGER=0`` option is no longer supported.