Force --hostonly when regenerating the initramfs

The dracut-config-generic package (sometimes installed by default in
the overcloud image) provides a configuration file that turns off the
host-specific initramfs generation with dracut:

$ cat /usr/lib/dracut/dracut.conf.d/02-generic-image.conf
hostonly="no"

The result is that the generated initrams does not contain:

- /etc/systemd/journald.conf
- /etc/systemd/system.conf
- /etc/hostname
- /etc/machine-id
- /etc/vconsole.conf
- /etc/locale.conf
- /etc/modules-load.d/*.conf
- /etc/sysctl.d/*.conf
- /etc/sysctl.conf

Especially problematic is the absence of sysctl.conf when ipv6 is
disabled via "KernelDisableIPv6: 1" because we end up half-disabling
ipv6 and services like rpbcind end up in failed state.

Original issue: https://bugs.launchpad.net/tripleo/+bug/1830574

This commit builds on top of https://review.opendev.org/#/c/661528/
adding the '--hostonly' option to dracut so to bypass 'hostonly="no"'
eventually contained in the default config file.

Change-Id: Ia4a39721268fe9bb0fdcc8bf4eb148263d4df46e
(cherry picked from commit 392eacb092)
This commit is contained in:
Luca Miccini 2019-06-20 15:52:47 +02:00
parent 8a30b6a9e1
commit 85692a695b
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class tripleo::profile::base::kernel (
# Rebuild initramfs to include kernel parameter changes in initramfs
exec { 'rebuild initramfs':
command => 'dracut -f -v',
command => 'dracut -f -v --hostonly',
path => '/bin:/sbin:/usr/bin:/usr/sbin',
refreshonly => true,
}