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

7116 Commits

Author SHA1 Message Date
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 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 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
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
Markus Hilger 5d97bc6a19 Stop a diskless boot when the root filesystem cannot be extracted
extract_untethered_rootimg reports failure, for example when the image
does not fit into the memory backed root, but imageboot.sh ignored it and
booted into the partly extracted root, which then hung later on. Stop
with a message saying why instead.
2026-11-01 22:16:57 +01:00
Markus Hilger eb4f1ad21a Fail clearly when confignet finds no network configuration tool
Without netplan, nmcli or wicked the manager variable was never set and
confignet died with a NameError. Say what is missing instead. Also pick
netplan over nmcli in the retry pass, as the first pass does, instead of
switching to NetworkManager on systems that have both.
2026-11-01 22:10:22 +01:00
Jarrod Johnson 26f27da575 Merge pull request #343 from Obihoernchen/fix/image2disk-bls-kernel-paths
Point boot entries at the kernel on the installed boot filesystem
2026-11-01 13:32:38 -05:00
Jarrod Johnson 5e3d0d0f6b Merge pull request #342 from Obihoernchen/fix/imgutil-el-rpmdb-path
Find the rpm database of an EL image of another generation
2026-11-01 13:31:21 -05:00
Jarrod Johnson c41b39643f Merge pull request #341 from Obihoernchen/fix/imgutil-apt-failure
Fail imgutil build when apt fails in an Ubuntu image
2026-11-01 13:28:19 -05:00
Jarrod Johnson c87ce57eda Merge pull request #340 from Obihoernchen/fix/nodeattrib-env-dotted-attrs
Fix nodeattrib -e for dotted attribute names in asynclient
2026-11-01 13:27:54 -05:00
Jarrod Johnson 84b232db63 Merge pull request #339 from Obihoernchen/fix/untethered-failover
Fall back to other managers for untethered images
2026-11-01 13:27:30 -05:00
Jarrod Johnson e02972a5b7 Merge pull request #344 from Obihoernchen/fix/imgutil-drop-boot-entries
Drop the boot entries kernel scriptlets write during imgutil build
2026-11-01 13:25:25 -05:00
Markus Hilger 54d9d1d20b Drop the boot entries kernel scriptlets write during imgutil build
The kernel package writes a boot loader entry inside the build chroot.
Its linux and initrd paths point into the scratch directory of the
server (grub2-mkrelpath sees the bind mount) and its options are the
kernel command line of the server. Diskless boot never reads it, but
after installing to disk it sits next to the entry post.sh writes on
the installed system, so grub may pick the broken one. Remove the
entries when building, post.sh writes the right one when installing.
2026-11-01 18:50:46 +01:00
Markus Hilger 0e824ec529 Reset the rpm database path macro on any error
The _dbpath macro set for fingerprinting an image is process global. It
was only removed after a successful query, so an error left it set and
later fingerprinting in the same process, which fancy_chroot does on
every command, read the wrong database.
2026-11-01 18:09:58 +01:00
Markus Hilger 8b4445e675 Query the release package in the image, not the host
Without the rpm Python bindings, fingerprinting an image found its
system-release provider in the image database but then ran rpm -qi
against the host, so an image whose release package the host lacks was
not recognized. Use the same rooted rpm command for both queries.
2026-11-01 16:59:52 +01:00
Markus Hilger 1d8d4f3077 Point boot entries at the kernel on the installed boot filesystem
image2disk rewrote root= in the boot loader entries but kept their
linux and initrd paths. Those come from where the image was built: in a
diskless image from imgutil they carry the scratch directory of the
server (grub2-mkrelpath sees its bind mount), and a /boot/ path does not
match the separate /boot filesystem image2disk creates for such images.
grub then fails with "you need to load the kernel". Make the paths
relative to the boot filesystem of the target.
2026-11-01 15:02:43 +01:00
Markus Hilger e70f66d2df Fail imgutil build when apt fails in an Ubuntu image
DebHandler raised SystemExit on a failed apt-get, but prep_root runs
under run_constrained, which only catches Exception and otherwise exits
0. A failed package install was therefore reported as a successful
build. Raise an Exception instead, as ElHandler already does.
2026-11-01 13:14:10 +01:00
Markus Hilger 7039706e4d Fix nodeattrib -e for dotted attribute names in asynclient
f9dc92ec fixed this in client.py, but nodeattrib has used asynclient.py
since 76efea7c, so it still sends the underscored name (info_note
instead of info.note) as the attribute, and a missing variable raises a
KeyError instead of a usage error. Port the client.py logic over.
2026-11-01 13:14:10 +01:00
Markus Hilger af8d91a507 Find the rpm database of an EL image of another generation
EL9 and older keep the rpm database in /var/lib/rpm, EL10 moved it to
/usr/lib/sysimage/rpm. fingerprint_host_el opened the image with the
default path of the host, so on an EL10 server an EL9 image was not
recognized (and an empty database was created in it). pack then wrote
no profile.yaml and no addons link, and import refused the image. Use
/var/lib/rpm when it is a real directory in the image. In EL10 it is a
relative link, so the default of the host still applies.
2026-11-01 13:14:10 +01:00
Markus Hilger 0839299bd4 Fall back to other managers for untethered images
An untethered or uncompressed diskless boot downloaded the root image
only from the deployment server and retried it forever when that server
failed. Try the other managers that answered discovery as well, as the
tethered urlmount already does.

urlmount limits each small range request to 10 seconds, but the single
whole-image download cannot take a total limit. Give up on a connect
after 10 seconds and on a transfer that stalls for 30 seconds instead,
so a hung server moves on to the next one.
2026-11-01 12:09:06 +01:00
Jarrod Johnson 89787671cf Merge pull request #338 from Obihoernchen/fix/ssh-agent-dir-owner
Hand /run/confluent/ssh to the confluent user
2026-10-31 09:21:18 -04:00
Jarrod Johnson f42a8ff667 Merge pull request #337 from Obihoernchen/fix/require-ipxe-2
Require confluent_ipxe 2.0.0
2026-10-31 09:20:34 -04:00
Jarrod Johnson 516930107f Merge pull request #336 from Obihoernchen/fix/nightly-publish
Various CI/CD improvements
2026-10-31 09:20:16 -04:00
Jarrod Johnson fa11d643ab Merge pull request #335 from Obihoernchen/fix/diskless-confluent-arg-ubuntu-suse
Support confluent= in Ubuntu diskless initramfs + sles16 diskless selinux
2026-10-31 09:19:12 -04:00
Jarrod Johnson 12a97a6eff Merge pull request #334 from Obihoernchen/fix/diskless-confluent-arg
Support confluent= in el9 and el10 diskless initramfs
2026-10-31 09:16:46 -04:00
Jarrod Johnson 97489aff8c Merge pull request #333 from Obihoernchen/fix/pre-without-ifidx
Skip bringing up the deploy nic without a discovered ifidx
2026-10-31 09:10:05 -04:00
Markus Hilger 8ff02dc772 Require confluent_ipxe 2.0.0
Fixes #317
2026-10-31 02:35:30 +01:00
Markus Hilger 905992f054 Hand /run/confluent/ssh to the confluent user
Fixes #316
2026-10-31 02:14:21 +01:00
Markus Hilger 83c2a05dbd Harden nightly publishing and bound CI job runtimes
Write the nightly release notes only after every bundle is uploaded.
The notes carry the build key that prepare compares against, so a
failed upload used to record the new build anyway, and the following
nights skipped it while the release kept stale or missing bundles.

Publish only from the default branch. A manual run defaulted to
publishing, so testing the workflow on a topic branch replaced the
nightly with that branch.

Run the packaging build on pull requests that touch MANIFEST.in, which
decides what goes into the client and server packages, or anything
under confluent_vtbufferd, which is compiled here and carries the only
debian/ packaging in the tree.

Give every job a timeout instead of the six hour default, so a hung
container or download fails within minutes.
2026-10-31 01:57:38 +01:00
Markus Hilger 551658b5fe Label overlay upper layer of suse16 diskless images for SELinux
The initramfs writes the overlay upper layer before the SELinux policy
is loaded, so those files are unlabeled_t. On an enforcing image /
itself is unlabeled, and logind, getty and sshd fail.

Label exactly the upper layer paths like el9-diskless does. The root
is an overlay in untethered mode too, so this covers both. chcon comes
from the image, the initramfs has none.
2026-10-31 01:37:16 +01:00
Markus Hilger 91370cb8a8 Support confluent= in Ubuntu diskless initramfs
Without it the server is only found by link-local discovery, so nodes
behind a DHCP relay never boot. Ported from el9-diskless. The initramfs
has dhcpcd from 24.04 on and only ipconfig before.
2026-10-31 00:50:45 +01:00