Skip to content

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 17 Sep 15:17

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 address of the form host:port no longer sends the whole
    string to DNS. The port is split off first, so mirror.example:8080
    resolves mirror.example — the old lookup could only fail, and did so at
    different speeds on different machines.

Added

  • netboot.dhcp is a package, and DHCP backends carry client options. A
    dhcpservers entry 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.options models them:
    GENERIC_OPTIONS for the names netboot translates, option-<n> for anything
    else, raw.<backend>= for untranslated backend-native text, and
    options_builder=my.mod.fn plus the new PixieEvent.BuildDhcpOptions for
    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-boot entries through pathlib_next paths, so
    the same configuration serves a local dnsmasq or one reached over sftp://
    (netboot[ssh]). hostsfile/optsfile may be a directory (one file per
    target — preferred, and with --dhcp-hostsdir/--dhcp-optsdir dnsmasq 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 sends reservation-add
    and reservation-del to the control agent, mapping boot-file-name,
    next-server and host-name onto reservation fields and everything else
    onto option-data. The subnet-id comes from the zone (subnet_id:) or is
    discovered once by matching the zone's network against config-get; when
    neither works netboot refuses rather than guessing, because a reservation in
    the wrong subnet silently never matches. A result: 2 from 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. Needs netboot[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's statements, 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 from keyfile= or
    $PIXIE_DHCPD_OMAPI_KEY, never from the URI. Needs netboot[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 the DhcpServer
    PowerShell module over ssh (the default, no dependency — it uses the system
    ssh client, so your config, keys, agent and jump hosts apply) or WinRM
    (netboot[winrm]). The transport host and the DHCP server are separate:
    server= becomes -ComputerName when 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], and netboot[ssh] for dnsmasq over
    sftp://. A local dnsmasq and windhcp:// over ssh need none. Verified on a
    clean wheel install: importing netboot.dhcp loads no backend dependency,
    those two backends construct, and the other two raise ImportError naming
    their extra.
  • Anything that varies per target is refused in a connection string and resolved
    when the target is applied instead: subnet_id/scope belong to the zone,
    boot-file-name/next-server/tftp-server-name to 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