Add per-model OptiPlex kickstart variants from live Cobbler
ci/woodpecker/push/pre-commit Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/push/validate Pipeline was successful
ci/woodpecker/pr/validate Pipeline was successful

The seed almalinux9 kickstart reconstructed the Cobbler contract from memory
and guessed storage: it installed to sda with autopart and keyboard us. The
real Cobbler server (cobbler.main.unkin.net) provisions the OptiPlex fleet from
three model-specific profiles (almalinux9-dell_3050 / _3060 / _7080) that all
install to NVMe with an explicit LVM layout and differ in disk selection, EFI
handling and whether the VG grows. This folds that real content in, keeping one
shared template driven by per-model catalog data.

Changes:
- Make almalinux9.ks.tmpl storage model-aware via .DistroVars.storage_mode:
  fixed-nvme (static nvme0n1, BIOS/MBR), auto-nvme (%pre picks the internal
  NVMe, UEFI-aware, --boot-drive), with vg_grow to grow the PV; generic/VM
  hosts keep the autopart-on-sda path.
- Port the explicit LVM layout (/boot, root, swap, /home, /var/log) and the
  %pre NVMe picker + rootvg wipe from the real Cobbler dell templates.
- Add catalog entries optiplex-3050 (fixed-nvme), optiplex-3060 (auto-nvme) and
  optiplex-7080 (auto-nvme + vg_grow), selected by a device's provision_template
  custom field set to the OptiPlex device_type slug.
- Correct keyboard us -> au and add the kdump addon + kexec-tools/bind-utils to
  match the Cobbler profiles.
- Document the per-model variants and selection in catalog/README.md.

Claude-Session: https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv
This commit is contained in:
2026-07-29 00:48:08 +10:00
parent 29f10e6150
commit 80dbcdd108
5 changed files with 185 additions and 3 deletions
+32 -1
View File
@@ -26,9 +26,40 @@ YAML + template change here — **no bootapi code change**.
## Shipped entries
- **almalinux9** — artifactapi `almalinux` remote, tree
`almalinux/<ver>/BaseOS/<arch>/os/`.
`almalinux/<ver>/BaseOS/<arch>/os/`. Generic / VM default (autopart on `sda`).
- **fedora** — artifactapi `fedora` remote, tree
`fedora/releases/<ver>/Everything/<arch>/os/`.
- **optiplex-3050 / optiplex-3060 / optiplex-7080** — AlmaLinux 9 on the Dell
OptiPlex fleet. Same install tree and `almalinux9` kickstart template, but
each passes a `storage_mode` (and, for the 7080, `vg_grow`) var so the one
template lays disks out per model. Ported from the Cobbler profiles
`almalinux9-dell_3050 / _3060 / _7080`. See "Per-model variants" below.
## Per-model variants (Dell OptiPlex)
Different OptiPlex models need slightly different storage handling, so each is
its own catalog entry selecting the shared `almalinux9` kickstart with a
model-specific `storage_mode` var:
| Entry | `storage_mode` | Disk selection | Firmware | LVM PV |
|-------|----------------|----------------|----------|--------|
| `optiplex-3050` | `fixed-nvme` | static `nvme0n1` | legacy BIOS/MBR | fixed ~31G |
| `optiplex-3060` | `auto-nvme` | `%pre` picks first NVMe <512G | UEFI-aware (EFI part if booted UEFI) | fixed ~31G |
| `optiplex-7080` | `auto-nvme` + `vg_grow: "true"` | `%pre` picks first NVMe <512G | UEFI-aware | grows to fill disk |
The kickstart (`kickstart/almalinux9.ks.tmpl`) reads `.DistroVars.storage_mode`
/ `.DistroVars.vg_grow` and renders the matching storage stanza; any entry
without those vars (e.g. plain `almalinux9`, `fedora`) gets the generic
autopart-on-`sda` path.
**Model selection (NetBox-driven, no code change):** the entry `name` is the
OptiPlex **device_type slug**. Set the device's `provision_template` custom
field to that slug (`optiplex-3050` / `-3060` / `-7080`) and bootapi's catalog
`Select` picks the matching entry (override precedence beats platform/family).
The `match.platforms` slug on each entry is the device_type slug too — not a
real NetBox platform slug — so these entries are *only* reachable via the
override and never hijack a plain `almalinux9` host. To add another model, copy
one of these files, change the `name`/slug and `storage_mode`.
## Adding another distro (the intended path)
+23
View File
@@ -0,0 +1,23 @@
# Distro catalog entry: AlmaLinux 9 on the Dell OptiPlex 3050.
#
# Same install tree as the generic almalinux9 entry, but with the storage layout
# the Cobbler profile almalinux9-dell_3050 used: a single known NVMe (nvme0n1),
# legacy BIOS/MBR boot, and a fixed ~31G LVM (no grow). Model selection is
# NetBox-driven: set the device's `provision_template` custom field to this
# entry's name (the OptiPlex device_type slug "optiplex-3050"). Because the
# match slug below is the device_type -- not a real platform slug -- this entry
# is never auto-selected for a plain almalinux9 host; only the override picks it.
name: optiplex-3050
match:
platforms: [optiplex-3050]
kickstart: almalinux9
version_default: "9"
kernel_url: "{{.ArtifactBase}}/almalinux/{{.Version}}/BaseOS/{{.Arch}}/os/images/pxeboot/vmlinuz"
initrd_url: "{{.ArtifactBase}}/almalinux/{{.Version}}/BaseOS/{{.Arch}}/os/images/pxeboot/initrd.img"
kernel_args:
- inst.text
- net.ifnames=0
vars:
mirror: "{{.ArtifactBase}}/almalinux/{{.Version}}"
# storage_mode drives the model-specific storage stanza in almalinux9.ks.tmpl.
storage_mode: fixed-nvme
+21
View File
@@ -0,0 +1,21 @@
# Distro catalog entry: AlmaLinux 9 on the Dell OptiPlex 3060.
#
# Same install tree as the generic almalinux9 entry, with the storage behaviour
# of the Cobbler profile almalinux9-dell_3060: a %pre script auto-selects the
# internal NVMe (first under 512G), is UEFI-aware (adds an EFI System Partition
# only when booted UEFI), sets bootloader --boot-drive, and uses a fixed ~31G
# LVM (no grow). Select it by setting the device's `provision_template` custom
# field to "optiplex-3060" (the OptiPlex device_type slug).
name: optiplex-3060
match:
platforms: [optiplex-3060]
kickstart: almalinux9
version_default: "9"
kernel_url: "{{.ArtifactBase}}/almalinux/{{.Version}}/BaseOS/{{.Arch}}/os/images/pxeboot/vmlinuz"
initrd_url: "{{.ArtifactBase}}/almalinux/{{.Version}}/BaseOS/{{.Arch}}/os/images/pxeboot/initrd.img"
kernel_args:
- inst.text
- net.ifnames=0
vars:
mirror: "{{.ArtifactBase}}/almalinux/{{.Version}}"
storage_mode: auto-nvme
+22
View File
@@ -0,0 +1,22 @@
# Distro catalog entry: AlmaLinux 9 on the Dell OptiPlex 7080.
#
# Identical to optiplex-3060 (auto-NVMe %pre, UEFI-aware, --boot-drive) EXCEPT
# the LVM PV grows to fill the disk -- the one real delta between the Cobbler
# profiles almalinux9-dell_3060 and almalinux9-dell_7080 (the 7080s ship larger
# NVMes and are meant to use the whole disk). vg_grow=true adds `--grow` to the
# pv partition. Select it via the device's `provision_template` custom field set
# to "optiplex-7080" (the OptiPlex device_type slug).
name: optiplex-7080
match:
platforms: [optiplex-7080]
kickstart: almalinux9
version_default: "9"
kernel_url: "{{.ArtifactBase}}/almalinux/{{.Version}}/BaseOS/{{.Arch}}/os/images/pxeboot/vmlinuz"
initrd_url: "{{.ArtifactBase}}/almalinux/{{.Version}}/BaseOS/{{.Arch}}/os/images/pxeboot/initrd.img"
kernel_args:
- inst.text
- net.ifnames=0
vars:
mirror: "{{.ArtifactBase}}/almalinux/{{.Version}}"
storage_mode: auto-nvme
vg_grow: "true"