Last updated: 2025-11-06
This document explains how to set up an advanced PXE boot server that uses iPXE to automate the installation of Debian 12 on new cluster nodes. This method is faster and more reliable than traditional PXE by leveraging HTTP instead of TFTP for the bulk of the file transfers.
The pxe_server Ansible role automates the setup of all necessary services for a modern, iPXE-based workflow:
- DHCP: Assigns IP addresses and provides boot information. It intelligently serves the correct iPXE bootloader (
.kpxefor BIOS,.efifor UEFI) to new clients. - TFTP: Serves only the initial, tiny iPXE bootloader.
- HTTP (Nginx): Serves the main iPXE boot script, the Debian kernel, the initrd, and the preseed configuration file.
- Preseed: Automates the Debian installation process.
Choose one of your controller_nodes to act as the PXE boot server. This machine must have a static IP address.
The setup is fully automated by the Ansible role. Simply create a new playbook file, for example pxe_setup.yaml, to apply the role to your chosen server:
---
- hosts: your_pxe_server_hostname
roles:
- pxe_serverRun the playbook:
ansible-playbook pxe_setup.yamlThe playbook will install and configure DHCP, TFTP, and Nginx, download the necessary iPXE and Debian boot files, and set up the iPXE boot script.
The DHCP server is configured to serve a range of IP addresses. For a more secure setup, you can edit the template at ansible/roles/pxe_server/templates/dhcpd.conf.j2 to only respond to specific MAC addresses.
On each new, bare-metal machine you want to provision:
- Enter the BIOS/UEFI setup.
- Enable "Network Boot" or "PXE Boot".
- Set the network card as the first boot device.
- Save and exit.
When the machine boots, it will perform the following automated chainload process:
- The client's built-in PXE ROM contacts the DHCP server.
- The DHCP server provides an IP and tells the client to download the iPXE bootloader from the TFTP server.
- The iPXE bootloader loads and makes a new DHCP request, identifying itself as "iPXE".
- The DHCP server responds with the URL to the iPXE boot script (e.g.,
http://<server_ip>/boot.ipxe). - iPXE downloads and executes the script, which then fetches the Debian kernel/initrd over HTTP and begins the automated installation using the preseed file.
Once the installation is complete, the machine will reboot into a fresh Debian system, ready for the main cluster provisioning with the playbook.yaml.