2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-11-12 11:06:17 +00:00

Leave the source hostname out of captured images

The image kept /etc/hostname of the source host, so a diskless node ran
under that name until onboot set its own, and early journal and syslog
entries carried the wrong name. With an empty /etc/hostname systemd
keeps the node name the deployment initramfs already set. Install to
disk writes /etc/hostname itself.
This commit is contained in:
Markus Hilger
2026-11-03 17:41:31 +01:00
parent 8fd70fd49a
commit e65a4e960b
+2
View File
@@ -240,6 +240,8 @@ def capture_fs(args):
masker.mask('/etc/pki/tls/private/*')
masker.mask('/root/.ssh/id_*')
masker.mask('/etc/netplan/*.yaml')
# an empty hostname keeps the node name the deployment initramfs set
masker.mask('/etc/hostname', '/run/imgutil/captmp/empty')
mksquashargs = ['mksquashfs', '/run/imgutil/capin', fname + '.sfs', '-comp', 'xz']
excludes = get_capture_excludes(mdir)
exfile = None