2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-11-14 21:08:06 +00:00
Commit Graph

7143 Commits

Author SHA1 Message Date
Jarrod Johnson 830b6892d6 Merge pull request #369 from Obihoernchen/fix/runansible-hangs
Stop hanging on ansible play processes that fail early
2026-11-04 08:38:33 -05:00
Jarrod Johnson 899542c128 Merge pull request #368 from Obihoernchen/fix/runansible-ansible-2.19
Run profile ansible plays on ansible-core 2.19 and later
2026-11-04 08:33:45 -05:00
Jarrod Johnson afc96a66e4 Merge pull request #366 from Obihoernchen/fix/ubuntu-install-fixes
Fix Ubuntu install to disk and installedargs
2026-11-04 08:28:59 -05:00
Jarrod Johnson 628a802433 Merge pull request #363 from Obihoernchen/fix/capture-exclude-tmp
Leave host specific leftovers out of captured images
2026-11-04 08:19:17 -05:00
Jarrod Johnson 1f0202b68c Merge pull request #362 from Obihoernchen/fix/capture-optional-lvm
Make lvm optional for capture
2026-11-04 08:06:41 -05:00
Jarrod Johnson ae4bbe5300 Merge pull request #361 from Obihoernchen/fix/image2disk-localstorage-recapture
Fix install to disk of recaptured localstorage LVM nodes
2026-11-04 08:05:52 -05:00
Jarrod Johnson f31305ab7b Merge pull request #360 from Obihoernchen/fix/image2disk-partition-overflow
Fix install to disk of images with plain partitions
2026-11-04 08:05:06 -05:00
Jarrod Johnson 2e62744fc1 Merge pull request #359 from Obihoernchen/fix/capture-prereqs
Require squashfs-tools and openssl for capture
2026-11-04 07:49:04 -05:00
Markus Hilger ec71d0b876 Stop hanging on ansible play processes that fail early
Drain the play process output while it runs, and stop waiting for its
feedback connection once it exits.
2026-11-04 00:23:33 +01:00
Markus Hilger 1cad52284d Run profile ansible plays on ansible-core 2.19 and later
Newer ansible-core only takes a stdout callback name and no longer
templates untrusted YAML. Attach the results collector directly, load
plays trusted through the DataLoader, and report a crashed play
process as a failed task.
2026-11-03 23:58:43 +01:00
Markus Hilger 244f75b0b2 Pass maxsplit to re.split as a keyword
ruff B034 flags the positional maxsplit argument.
2026-11-03 22:03:31 +01:00
Markus Hilger 9830518131 Apply installedargs to the grub configuration of Ubuntu installs
post.sh wrote installedargs into /etc/default/grub but only ran
update-grub when it had also added a console, so grub.cfg kept the old
command line until some later grub update.
2026-11-03 21:16:53 +01:00
Markus Hilger 8fd41b1315 Clean up the capture initramfs config on Ubuntu sources
Capture copies an initramfs-tools hook and conf.d/confluent.conf into the
source to build the deployment initramfs, but only ever removed the EL
dracut module afterwards. With MODULES=list left in place, the source's
next initramfs update was limited to the hook's driver list, and a source
captured again carried both files into the image, where rebuilding the
initramfs on install to disk shrank the clones' initramfs the same way.
Remove them after capture and leave them out of the image.
2026-11-03 21:16:47 +01:00
Markus Hilger ed49d131ad Strip the key from installedargs in Ubuntu installs
post.sh took the whole installedargs line from profile.yaml, key
included, so every Ubuntu install from these profiles got a literal
'installedargs:' in GRUB_CMDLINE_LINUX.
2026-11-03 20:23:43 +01:00
Markus Hilger 4b2c8c74c4 Rebuild the initramfs when installing Ubuntu images to disk
The installed system kept the initramfs of the image. Ubuntu 26.04
builds it with dracut in host-only mode, so a captured image's initramfs
waits for the source's volume group and filesystem UUIDs and the
installed node ends in emergency mode. Rebuild it in post.sh, as EL does
through kernel-install.
2026-11-03 20:23:43 +01:00
Markus Hilger ebd2d548a1 Keep source network profiles without static addresses
Dropping every NetworkManager profile and ifcfg file also removed
settings that confignet does not recreate from confluent attributes,
such as bonds, DHCP profiles, MTU or the InfiniBand transport mode. Only
drop the profiles that carry static addresses of the source.
2026-11-03 19:47:49 +01:00
Markus Hilger 80d55d2739 Leave dhcpcd and NetworkManager host identity out of captures
dhcpcd, present on Ubuntu 24.04 and later and on EL10, keeps its leases,
DUID and secret in /var/lib/dhcpcd, and NetworkManager keeps a secret in
secret_key. Copied into an image, every clone would use the same DHCPv6
DUID and derive the same stable privacy IPv6 addresses. Both regenerate
them when missing.
2026-11-03 19:35:39 +01:00
Markus Hilger e8206bb968 Leave dhclient leases of Debian and Ubuntu out of captures
dhclient keeps its leases in /var/lib/dhcp there, and on EL also as
*.leases next to the *.lease files already excluded. Keep dhcpd.leases
of a DHCP server, which lives in the same directory.
2026-11-03 19:34:23 +01:00
Markus Hilger e65a4e960b 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.
2026-11-03 17:41:31 +01:00
Markus Hilger 8fd70fd49a Leave the source network profiles out of captured images
Captured images kept the NetworkManager connection profiles and ifcfg
files of the source host. A diskless boot kept them too, and confignet
only rewrites the profiles named like the interfaces it configures, so
every other interface came up with the source host's settings, such as
its static addresses. Install to disk already removes them, and capture
already masks netplan files for the same reason. Drop them from the
image, except ifcfg-lo.
2026-11-03 17:27:51 +01:00
Markus Hilger b2a40e1370 Skip deactivating volume groups when lvm is absent
lvm is optional in the capture initramfs now, so installimage printed
'lvm: command not found' on every install of a capture taken from a host
without lvm2. Only run it when it is there.
2026-11-03 17:18:46 +01:00
Markus Hilger 3cf6684322 Keep hard linked files and odd names right in capture excludes
mksquashfs matches excluded paths by inode, so excluding a hard linked
file also dropped its other links elsewhere in the filesystem. Keep such
files in the image. squashfs-tools 4.3 also splits exclude file lines on
whitespace, so pass paths with whitespace or backslashes with -e instead.
2026-11-03 17:18:35 +01:00
Markus Hilger 115de4c00e Check for the localstorage volume group first
The guess for volume groups named by the OS installer (<os>_<node>)
matched any device mapper name with an underscore followed later by a
hyphen. A localstorage volume for a mount point with a hyphen, such as
localstorage-_srv_my--data, was taken for one and got a broken volume
group name. Recognize volumes of the target volume group before trying
that guess.
2026-11-03 17:17:31 +01:00
Markus Hilger 04f45bf542 Number new partitions in creation order in image2disk
The plain partitions were addressed by their number on the source system,
while parted numbers them in the order they are created. A source with a
gap, such as swap between filesystems (it is not captured), made
image2disk format the wrong partition and look for swap on one that does
not exist. Count the partitions as they are created instead.

Also look up filesystem UUIDs through one helper.
2026-11-03 17:17:11 +01:00
Markus Hilger b5a58ef770 Install images without LVM to disk
image2disk.py formatted the target filesystems, copied the image and
ran fixup only in the branch that sets up LVM. For an image whose
filesystems are all plain partitions it created the partitions and
returned success without writing anything, and installimage then failed
on the missing target.

Run that part for both layouts. Plain partitions also need their swap
in fstab by UUID instead of the localstorage-swap volume, and on EL9
and later root= and resume= refer to the new root and swap by UUID as
well, since partition names are not stable with several disks.
2026-11-03 16:53:21 +01:00
Markus Hilger 3bd3ebeadb Install recaptured images of LVM installed nodes to disk
image2disk.py puts the volumes of a node it installs into the volume
group localstorage. Capturing such a node and installing the profile to
disk again failed with 'No mapping defined to create volume group
localstorage': volumes named localstorage-root were taken for volumes of
an extra volume group that needs volumegroupmap.yml.

Treat volumes of a volume group named like the target one as main volume
group volumes, and split device mapper names into volume group and
logical volume names correctly, including hyphens that device mapper
doubles inside either name.
2026-11-03 16:51:59 +01:00
Markus Hilger e021d29afc Keep image2disk partitions inside the disk
When the largest filesystem of a captured image is a plain partition,
it was sized as the disk minus the other filesystems. That ignored the
2048 sector gap before the first partition and the rounding of every
partition up to a 2048 sector boundary, so the last partition always
ran past the end of the disk. The clamp then set its end to the sector
count, one past the last sector and inside the backup GPT, and parted
refused it with 'The location ... is outside of the device'. Images
with the largest filesystem in LVM were not affected.

Reserve that overhead plus 1MiB at the end of the disk for the backup
GPT, and clamp to that last sector instead. Also round the swap
partition by its own size rather than by the previous partition's.
2026-11-03 15:45:52 +01:00
Markus Hilger 94d396a8cb Leave host specific leftovers out of captured images
Capture copied everything on the local filesystems, including user
files and sockets in /tmp and /var/tmp, crash dumps, logs and the
persistent journal, sssd cached credentials, package caches, the
random seed, DHCP leases and root's shell history. All of it ended up
on every node deployed from the profile.

Drop the contents of scratch, crash, journal, mail spool, sssd cache
and package cache directories, keep only the directory tree under
/var/log and /var/cache/apt since daemons expect their subdirectories
there, and drop a short list of individual files. The directories
themselves are kept, so their mode, ownership and labels survive.
mksquashfs gets the paths as an exclude file, so this applies the same
way whether or not a directory is its own mount.
2026-11-03 15:16:26 +01:00
Markus Hilger 48ff272c67 Make lvm optional in capture deployment initramfs
Hosts without lvm2 installed made dracut report a FAILED dracut-install
during imgutil capture. The initramfs was still built, just without lvm.
lvm is only used there to deactivate stale volume groups before the
install. Any LVM layout is created from inside the image, which carries
its own lvm2 when the source used LVM.

Mark lvm optional, the same way unsquashfs already is.
2026-11-03 15:06:24 +01:00
Markus Hilger 1be306d98d Require squashfs-tools and openssl for capture
mksquashfs packs the image and the dracut module needs openssl. Without
them capture failed silently and only the later rsync of private.key
reported an error. Also stop when capturing a filesystem fails, unmount
the capture tmpfs on the target, and have run_constrained print the
exception it used to swallow. squashfs-tools is now required, so drop
the optional prerequisite reporting.
2026-11-02 19:29:57 +01:00
Jarrod Johnson 5db785896e Merge pull request #358 from Obihoernchen/fix/capture-selinux-module
Let tethered captured SELinux images reach the image server
4.0.1
2026-11-02 13:25:21 -05:00
Jarrod Johnson 0508176641 Merge pull request #357 from Obihoernchen/fix/diskless-profile-dirs
Add missing script directories to el10 and Ubuntu diskless profiles
2026-11-02 13:24:44 -05:00
Markus Hilger 7c2985ad2c Let tethered captured SELinux images reach the image server
Captured images keep the policy of the source, which lacks the rules
images built with --selinux get. Install them on the source for the
capture and remove them again afterwards, unless the source already
had them.
2026-11-02 18:36:59 +01:00
Markus Hilger 3debfdaee0 Add missing script directories to el10 and Ubuntu diskless profiles
Their scripts run onboot.d and the others, but the profiles did not
have them like el8 and el9. el10 also lacked the syncfiles template,
now linked to el9's like its other shared files, and Ubuntu lacked the
firstboot.custom that its firstboot.sh runs.
2026-11-02 18:12:47 +01:00
Jarrod Johnson 734ea9811a Also check if shim can be downloaded using tftp 2026-11-02 11:39:25 -05:00
Jarrod Johnson 293a12497f Better filter against stray directories in imputil unpack 2026-11-02 11:03:56 -05:00
Jarrod Johnson 8f193d0e61 Bump version number 2026-11-02 10:41:13 -05:00
Jarrod Johnson 0ece84bec6 Fix terminal state on nodeconsole exit 2026-11-02 09:13:38 -05:00
Jarrod Johnson 050936e6f4 Merge pull request #353 from Obihoernchen/feat/fix-urlmount-shutdown
Keep urlmount alive during system shutdown
2026-11-02 07:53:08 -05:00
Jarrod Johnson fdfc033502 Merge pull request #350 from Obihoernchen/fix/imgutil-clean-package-caches
Remove package manager caches from images built by imgutil
2026-11-02 07:52:32 -05:00
Jarrod Johnson da5d87253f Merge pull request #349 from Obihoernchen/fix/imgutil-selinux-urlmount
Let tethered SELinux images reach the image server
2026-11-02 07:51:09 -05:00
Jarrod Johnson 813ddd4d05 Merge pull request #348 from Obihoernchen/fix/confignet-no-network-tool
Fail clearly when confignet finds no network configuration tool
2026-11-02 07:50:24 -05:00
Jarrod Johnson 0c85cbcc26 Merge pull request #347 from Obihoernchen/fix/imgutil-build-full-selinux-context
Set full SELinux contexts on images built with --selinux
2026-11-02 07:49:56 -05:00
Jarrod Johnson 75402fe9ba Merge pull request #346 from Obihoernchen/fix/ubuntu-diskless-netplan-perms
Restrict the netplan file written by Ubuntu diskless boot
2026-11-02 07:49:20 -05:00
Jarrod Johnson 016db810ea Merge pull request #345 from Obihoernchen/fix/diskless-stop-on-extract-failure
Stop a diskless boot when the root filesystem cannot be extracted
2026-11-02 07:49:09 -05:00
Markus Hilger 061f2facec Keep urlmount alive during system shutdown
Mark urlmount as an initramfs root storage daemon before entering FUSE so systemd-shutdown does not wait for or kill the process serving the root image.
2026-11-02 02:37:23 +01:00
Markus Hilger 5db3c837e3 Remove package manager caches from images built by imgutil
imgutil build left the downloaded packages and repository metadata in
the image: 1.3 GB of .deb archives plus 145 MB of package lists for
Ubuntu 26.04, about 100 to 160 MB of dnf metadata for EL and 80 MB of
zypp metadata for Leap 16. Untethered nodes copy all of it into memory.
Remove them after building. Installing more packages into the image
then needs a repository refresh first, as usual for images.
2026-11-01 23:31:36 +01:00
Markus Hilger cb09845fcd Set full SELinux contexts on images built with --selinux
setfiles without -F only corrects the type of a file and keeps its user,
role and range. Files of a new build tree get the SELinux user of the
process that created them, so about 1800 of them stayed unconfined_u
instead of system_u. Label the new tree with -F. Pack keeps relabeling
without it, so contexts set on purpose in a captured or edited tree stay.
2026-11-01 22:41:06 +01:00
Markus Hilger 6bdc3e17d7 Restrict the netplan file written by Ubuntu diskless boot
imageboot.sh wrote /etc/netplan/10-<iface>-confluentcfg.yaml with the
default mode 0644, and netplan warns that its configuration should not
be accessible by others. confignet already writes its files 0600, but
it leaves an identical file in place, so the boot-time one stayed 0644.
2026-11-01 22:39:31 +01:00
Markus Hilger ebdb71f321 Let tethered SELinux images reach the image server
urlmount is started by the initramfs before the policy is loaded, so it
keeps running as kernel_t. The EL10 targeted policy denies kernel_t
connecting to http_port_t, so after systemd loads the policy every read
of a tethered root image that needs a new connection fails and the node
freezes. imageboot.sh also runs dd from the initramfs later, which is
denied entrypoint. Install a small module with exactly these two rules
in images built with --selinux.
2026-11-01 22:16:57 +01:00