Skip to main content

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

Project description

netboot

PyPI Python versions License: MIT Docs CI

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            # provides the `pixie` command
# 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

pixie = Pixie(**config)                  # config: the merged YAML mapping
target = pixie.lookup_target("my-host")
ctx = pixie.make_context(target)         # render context (image + dhcpzone + target)
print(ctx.render("boot.ipxe.j2"))        # render a template against the context
pixie.initialize(target)                 # arm DHCP for the target
pixie.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.1.tar.gz (36.1 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.1-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: netboot-0.1.1.tar.gz
  • Upload date:
  • Size: 36.1 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.1.tar.gz
Algorithm Hash digest
SHA256 a82eb6354c09256fe624fcd95b3efc91bb3b483fa65f739050efdef071e22d9c
MD5 8adb269e5865479d8e754f533539737b
BLAKE2b-256 74daf48c65eb5f66c54f40f0ae3b7b3d2c4bcbdc6ac0f7dab78a0e93f69ca3c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for netboot-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: netboot-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 33.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b311a9340e381a6977e017c10c795c71ce755c462cf6a3882e538aa999d6073
MD5 daddabdb560120c5a6ec3718a7ae0264
BLAKE2b-256 f0d8be69edace6397d69fa26706b7b700a8d992b59be4cd31be1bc65fff7c89f

See more details on using hashes here.

Provenance

The following attestation bundles were made for netboot-0.1.1-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