2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-02 07:26:04 +00:00
Commit Graph

1180 Commits

Author SHA1 Message Date
Jarrod Johnson 116d4aeb04 Make m.2 form factor drives a high priority as a matter of course for OS install 2026-08-27 15:41:49 -04:00
Robert Caliman bdfd1ddfe8 Change the getinstalldisk logic to account for M2 standalone disks 2026-08-27 21:27:46 +03:00
Jarrod Johnson 1da744fcab Draft media based images
Prepare for media based diskless images
2026-08-26 16:13:34 -04:00
Jarrod Johnson bbad91369f Tighten permissions on netplan files 2026-08-26 15:36:27 -04:00
Jarrod Johnson 9d6c6495bf Fix SLES 16 install when no serial console
autoinstall is run without a tty, so detect that and use tty1 instead.

Also, clean up agama config by avoiding too many duplicated network entries.
2026-08-24 11:31:31 -04:00
Jarrod Johnson 2308ee57fe Try to add altname for connection name. 2026-08-21 17:27:36 -04:00
Jarrod Johnson 138b776c9c Recognize SATA m.2 drives
SATA drives do not directly have a busaddr.

However, at some point the PCI bus comes up in the udev hierarchy as a KERNELS value.

If that matches a detected M.2 slot, then accept the storage as M.2.
2026-08-20 12:03:09 -04:00
Jarrod Johnson e9e5fc2516 Only add [] if the address is ipv6-like 2026-08-14 14:36:50 -04:00
Jarrod Johnson 8d618b354e dhcpcd is a function in the profile, source the profile to have it available in the script 2026-08-14 13:30:36 -04:00
Jarrod Johnson 8f5d68ba3c Remove extraneous output from the tpm pcr bank identification 2026-08-12 15:48:09 -04:00
Jarrod Johnson 8ec8ce5289 Fix pcr extend
Using the subshell prevented variable from being set.

No longer use a subshell.
2026-08-12 15:36:49 -04:00
Jarrod Johnson d175d06b8d Change extend to change extend by appropriate hash size. 2026-08-12 14:48:57 -04:00
Jarrod Johnson b37af50c3f Use other TPM PCR banks
Some TPMs are configured to use other pcr banks.

For now, prefer the sha256 for compatibility.
2026-08-12 13:51:29 -04:00
Jarrod Johnson ae664717e4 Fix Ubuntu encrypted OS volume setup
Actually install the dependencies needed, and correct path to detect need to re-seal when PCRs requested
2026-08-11 11:46:37 -04:00
Jarrod Johnson e3dbdbd44d Fix missing tpm2-tools
Needed for full TPM based boot
2026-08-11 09:38:41 -04:00
Jarrod Johnson 3c820d7600 Remove redundant print 2026-08-11 09:26:03 -04:00
Jarrod Johnson 7677267ada Change TPM reseal to be more generic
The crypttab in Ubuntu does not have that indication.  Instead just iterate through
crypttab devices and for any tpm2 sealed ones, reseal them.
2026-08-11 09:23:36 -04:00
Jarrod Johnson 0746b843d2 Change Ubuntu to seal to pcrs on firstboot
Consistent with changes for EL, seal PCRs on firstboot to extend the usefulness of some sealing.
2026-08-11 08:43:25 -04:00
Jarrod Johnson 486540d24d Correct checking encryptboot pcrs in firstboot 2026-08-10 14:22:12 -04:00
Jarrod Johnson 730f645dc0 Defer PCR sealing to first boot
If someone wants to seal to a PCR
explicitly to prevent booting rescue, the PCR is likely to
extend differently during install.

Leave the volume sealed to the tpm without any PCRs until first boot.

Then wipe the bindings without PCR specified, and seal according to user preferred values.
2026-08-10 13:59:28 -04:00
Jarrod Johnson 0c18bc1c01 Older ESXi does not support listdetailed, support normal list. 2026-08-10 11:08:32 -04:00
Markus Hilger 461385522c Accept lastchance in every network manager
The retry pass calls apply_configuration with lastchance=True, which only
NetworkManager accepts. It is unreachable today, since only NetworkManager
returns the 1 that fills the retry list, but it springs the moment either of
the others grows a return, or the retry selection is brought in line with the
first pass. Matching the signatures costs nothing.
2026-08-10 14:36:37 +02:00
Markus Hilger 644843b892 Remove unused imports and pointless f-string prefixes (F401, F541, E713)
Entirely mechanical, produced by `ruff check --fix --select F401,F541,E713`
and reviewed rather than taken on faith: deleting an import is only safe if
nothing imports it for its side effects or re-exports it.  None of the 19
removed names is referenced anywhere in its file, none appears in any string
literal, and none of the touched files uses eval, exec, globals() or
__import__, so there is no dynamic lookup that could reach them.
2026-08-10 05:32:00 +02:00
Markus Hilger fcacaca79d Use a raw string for a regex escape (W605)
'\s' is not a recognised string escape.  Python still accepts it today but
warns, and it becomes a syntax error in a future release.
2026-08-10 05:32:00 +02:00
Markus Hilger 5d9e30de7b Stop loop variables from shadowing what they iterate (B020)
Each of these loops rebinds the name that holds the iterable.  They work
today because the iterable is evaluated once before the loop starts, but
the name is then gone, so any later use reads a loop item instead of the
collection.

- nodeinventory: `for arg in args` / `for arg in arg.split(',')`.
- confignet (common and debian copies): iname holds the comma separated
  interface list and is then reused for each interface in it.
- xcc _get_agentless_firmware: adata holds the adapter query response and
  is then reused for each adapter.

No behaviour change, just distinct names for distinct things.
2026-08-10 05:32:00 +02:00
Jarrod Johnson 76aef703ff avoid moving firmware directories if they don't exist 2026-08-07 15:42:10 -04:00
Jarrod Johnson 94c1683663 Add support for specifying tpm2 pcrs in the encryptboot attribute
This allows a user to opt into pcrs if they understand what they are doing.

Some PCRs are sensitive to firmware updates and some are sensitive to boot loader, kernel, boot config, or initramfs.  All of these are an opportunity for an unsuspecting update to remove access to the boot volume.  There are update processes that can be put into place to make this work,
but it is up to the OS update process to address that, and
OS update processes are likely not to address that at this time.
2026-08-06 16:07:19 -04:00
Jarrod Johnson c063cbff3a Change to using systemd-cryptenroll where available 2026-08-06 15:34:20 -04:00
Jarrod Johnson cc898d5661 Diseregard proxy for various confluent interactions
In some environments, http proxy is set for internet, but does not work internally.

Accommodate by suspending the proxy in confluent contexts.
2026-08-06 12:15:44 -04:00
Jarrod Johnson 5dce6f2b21 Fix identity image deployment of suse 15
The default 'cp' is /lbin/cp, but that fails, use full path to the cp that works.

Perform the hmac registration of api key that was missing.

Remove assumption that the ip will be ipv6, wrapping it only if a : is present in address.
2026-08-04 12:45:52 -04:00
Jarrod Johnson e05707da2e Remove -k from curl invocation 2026-08-04 11:15:53 -04:00
Jarrod Johnson d468f3afb6 Add identity image to the SUSE15 install 2026-08-04 09:21:11 -04:00
Markus Hilger 9788d563aa Apply chown before chmod in syncfileclient permission handling
chown() clears the setuid bit of a file on Linux (and its setgid bit, if
the file is group-executable), even when run by root and even when the
owner/group are unchanged. Since the owner/group chown ran after the
permissions chmod, any syncfiles entry combining owner=/group= with a
setuid/setgid permissions= value silently lost the special bits.
2026-08-04 04:33:04 +02:00
Markus Hilger 165d229178 Remove missing old obsolete syncfileclient from consolidation 2026-08-03 15:24:15 +02:00
Markus Hilger c0bc33e494 Report syncfiles failures instead of discarding them
get_syncresult() caught the sync task's exception, logged a repr server
side and returned 200 OK with a null body.  The node then called
.get('options') on that null resulted in:

  c1: 'NoneType' object has no attribute 'get'

and syncfileclient still exited 0 as if syncing had succeeded.

Return the error to the requestor as a 500 with an error payload.  On
the node, unwrap the body that grab_url_with_status raises for a
non-success status, print it once and exit non-zero.  Only a failure the
server deliberately reported for this sync is terminal. Anything else,
such as a dropped connection, is re-raised so the existing retry loop
handles it as before.  The same case now reports

  c1: Error performing syncfiles: Syncing failed due to unreadable files: /etc/dangling.conf
  c1: 'syncfileclient' exited with code 1
2026-08-03 15:17:15 +02:00
Jarrod Johnson e213949bf0 Bring fix in from el8-diskless edition of syncfileclient 2026-08-03 08:49:55 -04:00
Jarrod Johnson c3cf2a402f Remove redundant copies of syncfileclient 2026-08-03 08:48:28 -04:00
Jarrod Johnson 6853fd2833 Move syncfileclient to common
It is largely the samey
2026-08-03 08:47:16 -04:00
Jarrod Johnson d7dcb07a3f Implement deployment.storage
This is an attribute for a node to indicate preferences for storage.

For now, 'm2' policy will hit m.2 and mirroring kits.
2026-07-28 15:02:27 -04:00
Jarrod Johnson 3501f70c37 Merge pull request #247 from Obihoernchen/unsquashfs
Use multi-threaded unsquashfs to extract untethered images
2026-07-28 08:59:38 -04:00
Markus Hilger 67e84f15f8 Keep the root filesystem guard reachable when extraction fails
source_remote imageboot.sh is the last thing the diskless cmdline hook
runs, so returning early on a failed extraction ended the hook and left
dracut to time out. Falling through instead reaches the existing
/sysroot/sbin/init guard, which reports the failure and holds the node so
it stays reachable over ssh, as it did before extraction was checked.
2026-07-28 01:49:38 +02:00
Markus Hilger d9da502fbe Copy LICENSE into confluent_osdeploy before leaving the directory
The copy ran after the cd to the repo root, so it read ../LICENSE from
outside the checkout and never placed the file in confluent_osdeploy/. The
tarball went out without it and the spec's %install, which does
"cp LICENSE" after %setup cds into the unpacked directory, failed.
imgutil/buildrpm already copies before its cd; do the same here.

The aarch64 spec has its LICENSE lines commented out, so only the x86_64
build broke, but the copy was equally wrong in both scripts.
2026-07-27 20:19:39 +02:00
Markus Hilger a9d7b67929 Derive build versions from a tracked VERSION file
Release tags do not live on master: 3.15.2 through 3.15.6 were tagged on branch
3.15, so git describe reaches only 3.15.1 and dev builds were stamped
3.15.2.dev<n>. Besides being confusing, rpm and dpkg both rank the released
3.15.6 above that, so a dev package will not install over a released one.

Add a top-level VERSION file naming the release the branch is working toward
(4.0.0 on master) and a mkversion helper that stamps packages from it, keeping
the tag-derived value as a floor so a forgotten bump cannot go backwards.
mkversion also replaces the block copy-pasted into seven build scripts, and
makesetup no longer writes a per-package VERSION file, so the stale checked-in
confluent_common/VERSION goes with it.
2026-07-27 20:06:22 +02:00
Jarrod Johnson b3b16c6497 Do not fail on inability to do REUSEPORT 2026-07-24 11:52:41 -04:00
Jarrod Johnson 61e0524a56 Some fixup of SELinux contexts for EL10 diskless boot
Unfortunately, the problem of urlmount's selinux context is left open.

urlmount starts before policy load, preventing transition.

However the policy blocks access urlmount needs when loaded.
2026-07-23 15:58:07 -04:00
Jarrod Johnson 5136b95cde Adjust to EL10 grub stub cfg
The syntax changed, make the code more adaptive to a variety of situations.
2026-07-20 17:11:19 -04:00
Jarrod Johnson 9dfb3ea42b Merge pull request #250 from Obihoernchen/stateless-booted-status
Report stateless boot completion via new 'booted' status
2026-07-20 12:55:55 -04:00
Markus Hilger 9101b07d54 Report stateless boot completion via new 'booted' status
Diskless profiles had the updatestatus callback in onboot.sh commented
out because no suitable status existed: 'complete' clears
deployment.pendingprofile, which the PXE responder requires to answer
the next network boot of a diskless node.

Add a 'booted' status that records the pending profile as
deployment.profile while leaving pendingprofile armed and skipping
autolock, and enable the onboot.sh callback in all diskless profiles.
nodedeploy now shows 'pending: <profile> (booted)' for a running
stateless node.
2026-07-20 15:59:30 +02:00
Markus Hilger 73c5b9cebf Comment out the MERGE statement in syncfiles
It's confusing for users to have this enabled by default.
This should be opt-in as everything else.
2026-07-18 03:40:48 +02:00
Jarrod Johnson 12ef3fc529 Merge pull request #245 from Obihoernchen/selinux
SELinux label diskless runtime files on EL
2026-07-16 20:10:43 -04:00