Repository navigation
v0.2.1
netboot ships DHCP backends. Additive: nothing documented changed behaviour,
and a config that named no dhcpservers scheme netboot implements works as
before.
Fixed
- A repository
addressof the formhost:portno longer sends the whole
string to DNS. The port is split off first, somirror.example:8080
resolvesmirror.example— the old lookup could only fail, and did so at
different speeds on different machines.
Added
netboot.dhcpis a package, and DHCP backends carry client options. A
dhcpserversentry is still a plain URI string; its query string now holds the
options the server should give the client (?router=10.0.0.1), alongside each
backend's own connection settings.netboot.dhcp.optionsmodels them:
GENERIC_OPTIONSfor the names netboot translates,option-<n>for anything
else,raw.<backend>=for untranslated backend-native text, and
options_builder=my.mod.fnplus the newPixieEvent.BuildDhcpOptionsfor
building them from the context. Merge order, later winning: zone defaults, the
connection query,image.dhcp_options,target.dhcp_options, the callback,
the hook.- A dnsmasq backend (
dnsmasq://), the first netboot ships. It writes
dhcp-host/dhcp-option/dhcp-bootentries throughpathlib_nextpaths, so
the same configuration serves a local dnsmasq or one reached oversftp://
(netboot[ssh]).hostsfile/optsfilemay be a directory (one file per
target — preferred, and with--dhcp-hostsdir/--dhcp-optsdirdnsmasq re-reads
them with no signal at all) or a file, where netboot edits only its own
marked region and never touches a line it did not write.reload=runs a
command, over ssh when the URI names a host; omitting it is fine for a watched
directory and an error for a file, which dnsmasq never re-reads by itself. - A Kea backend (
kea://,keas://for https). It sendsreservation-add
andreservation-delto the control agent, mappingboot-file-name,
next-serverandhost-nameonto reservation fields and everything else
ontooption-data. Thesubnet-idcomes from the zone (subnet_id:) or is
discovered once by matching the zone's network againstconfig-get; when
neither works netboot refuses rather than guessing, because a reservation in
the wrong subnet silently never matches. Aresult: 2from Kea is reported
with the likely cause (host_cmds not loaded, or a read-only hosts backend),
and an existing reservation for the same MAC is refused rather than
overwritten. Needsnetboot[kea]. - An ISC dhcpd backend (
dhcpd://) over OMAPI, the only way to give dhcpd a
reservation without rewriting and reloading its config. Options are rendered
into the host'sstatements, which is dhcpd config source: text values are
quoted with"and\escaped, a value meant to be an address must look like
one, and a newline is refused outright — a value cannot end its statement and
start another. The OMAPI secret comes fromkeyfile=or
$PIXIE_DHCPD_OMAPI_KEY, never from the URI. Needsnetboot[dhcpd]. Note
that a host added over OMAPI does not survive a dhcpd restart by itself: that
is dhcpd's design, not netboot forgetting it. - A Windows DHCP Server backend (
windhcp://), driving theDhcpServer
PowerShell module over ssh (the default, no dependency — it uses the system
sshclient, so your config, keys, agent and jump hosts apply) or WinRM
(netboot[winrm]). The transport host and the DHCP server are separate:
server=becomes-ComputerNamewhen the cmdlets should act elsewhere. The
scope is the zone's network address, resolved when the target is applied and
overridable per zone. No value is interpolated into the script: parameters
travel as a JSON payload PowerShell parses, so a target name or option value
cannot become a statement. - New extras, each carrying exactly one backend's dependency:
netboot[kea],
netboot[dhcpd],netboot[winrm], andnetboot[ssh]for dnsmasq over
sftp://. A local dnsmasq andwindhcp://over ssh need none. Verified on a
clean wheel install: importingnetboot.dhcploads no backend dependency,
those two backends construct, and the other two raiseImportErrornaming
their extra. - Anything that varies per target is refused in a connection string and resolved
when the target is applied instead:subnet_id/scopebelong to the zone,
boot-file-name/next-server/tftp-server-nameto the image or target. The
error names where each belongs.from netboot.dhcp import DhcpServer, DhcpZone
is unchanged, and a backend module is imported only when a config names its
scheme.
Full Changelog: v0.2.0...v0.2.1