Discovery iPXE + %pre collection template + catalog entry #5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
There is no discovery artifact set.
ipxe/hasboot,fallback-shell,fallback-local;kickstart/has animage.ks.tmpland per-distro templates;catalog/has per-model entries (optiplex-3050/3060/3070/7080,*-image). None of these collect a machine's hardware identity or LLDP topology at first boot, which bootapi needs to auto-populate NetBox for an unknown device (see bootapi companion issue).Proposal
Add the template/catalog side of the discovery boot flow:
ipxe/discovery.ipxe.tmpl— chained by bootapi on a NetBox-miss; loads the discovery live image (kernel/initrd from bootapi-images) with a kernel arg pointing back at the bootapi discover endpoint.kickstart/discovery.ks.tmpl(or a live-image init) — a%pre-style stage that runs and POSTs JSON to bootapi:dmidecode -s system-serial-number/system-product-name/system-uuid(+ board, chassis).ip -j linkto enumerate every physical NIC (name + MAC + operstate) — noenp2s0assumption (3060 =enp1s0); match key is MAC / lowest physical NIC.lldpctl -f json(install/runlldpdin the image) for switch chassis-id/sysname + port — the sole topology source.lscpu/free/lsblk -Jinventory.Emits one JSON blob
curl -X POSTto$discover_url(kernel arg), thenreboot.catalog/discovery.yaml— describes the discovery image (kernel/initrd artifact names in bootapi-images, packages:dmidecode,iproute,lldpd,curl).*-imagecatalog pattern, e.g.optiplex-7080-image/almalinux9-image).Acceptance
discovery.ipxe.tmpl+discovery.ks.tmpl(or live-init) +catalog/discovery.yamlexist and render.%pre/init collects serial/model/UUID, all NICs (name+MAC, enumeration-based), andlldpctlneighbours, and POSTs them to bootapi's discover endpoint, then reboots.Cross-refs
Companion: unkin/bootapi#3 (bootapi discovery decision + NetBox writes).