Skip to main content

PXE provisioning management: render netboot artifacts and drive DHCP for targets

Project description

netboot

PXE provisioning management: describe your netboot targets, images and DHCP zones in config, and let netboot render the per-target boot artifacts and arm (or disarm) DHCP for a machine as it enters and leaves the install process.

netboot is a small, hook-driven engine. A YAML config declares targets (host/MAC/IP), images (what to boot), dhcp zones (the network a target lives on) and content repos (where artifacts are fetched/served from). For a given target netboot builds a render context and produces netboot files from Jinja2 or shell-style templates, resolving names by MAC, hostname or IP with sensible fallbacks. Backends and behaviour are extensible through an event-hook system and pluggable DhcpServer handlers.

Install

pip install netboot            # once published
# or, from a checkout:
pip install .

Optional extras:

Extra Enables
netboot[config] YAML config loading for the CLI (pyyaml)
netboot[dns] DNS resolution of hostname targets (dnspython)
netboot[docs] Build the documentation site (mkdocs)

Built on duho (CLI/args/command discovery), pathlib_next (URI-aware paths), yaconfiglib (layered YAML), and Jinja2. IP/MAC/DNS helpers are vendored in-tree (netboot._netutils).

CLI

The command is pixie (PXE is pronounced "pixie"); netboot is the library package it drives.

# Initiate the PXE process for a target (render artifacts + arm DHCP):
pixie initiate my-host

# Complete it (post-boot cleanup, disarm DHCP):
pixie complete my-host

Global options:

Option Purpose
-c, --config PATH Explicit config file (yaml/cfg)
--baseconfig DIR Base config directory to search (default ./config)
-l, --load-module M Import module(s) before building netboot (config/hook deps)
--cmdspath PATH Extra directories/packages to search for commands

A target is looked up by exact id, or by hostname prefix / MAC / IP.

Library

from netboot import Pixie

netboot = Pixie(**config)                 # config: the merged YAML mapping
target = netboot.lookup_target("my-host")
ctx = netboot.make_context(target)       # render context (image + dhcpzone + target)
print(ctx.render("boot.ipxe.j2"))     # render a template against the context
netboot.initialize(target)               # arm DHCP for the target
netboot.complete(target)                 # cleanup once installed

Extending

  • Hooks. Pass hooks=[...] (callables or "module.func" import strings) to Pixie(...). Each hook f(event, netboot, value, kwargs) -> value is called for every PixieEvent and may transform the value flowing through it — used to customise lookup, context construction and the init/complete lifecycle.
  • DHCP backends. Subclass netboot.dhcp.DhcpServer; the lowercased class name is the URI scheme it handles (class dnsmasq(DhcpServer)dnsmasq://...). Import your plugin module via --load-module so it is registered before the config builds the zones.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netboot-0.1.0.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netboot-0.1.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file netboot-0.1.0.tar.gz.

File metadata

  • Download URL: netboot-0.1.0.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for netboot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1788a60308571d3d108bc6226f6731a6d8a89a4264f45f06dea0ce5c8a881a8a
MD5 48f1cde8af14cf22ae26b1958341340b
BLAKE2b-256 fd3ac3f6ae78c9d5fd37a9b5b4ac877a08f426f04e950131d9d7e461d6c85142

See more details on using hashes here.

Provenance

The following attestation bundles were made for netboot-0.1.0.tar.gz:

Publisher: release.yml on jose-pr/netboot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netboot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: netboot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for netboot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 217761ee96605189cc98ff94158d860b56e20f09721cf8510a156f4cfe4eb1dd
MD5 6b95c857a1344de0c9fe3b96d059d07b
BLAKE2b-256 36373806546704446a301cdfa71c0db30d0f18ede2bc11cde8999eb720688b11

See more details on using hashes here.

Provenance

The following attestation bundles were made for netboot-0.1.0-py3-none-any.whl:

Publisher: release.yml on jose-pr/netboot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page