This repository provides an automated solution for creating customized Debian 12 (Bookworm) installation ISOs with UEFI/GPT support through preseed configuration, designed to prepare systems for seamless Ansible adoption with pre-configured SSH key access or temporary password authentication.
-
Install genisoimage: This tool is required to create the custom ISO
sudo apt-get update && sudo apt-get install -y genisoimage
-
Install isohybrid: This tool is required to make the ISO bootable as a USB device with UEFI support
sudo apt-get update && sudo apt-get install -y syslinux syslinux-utils
-
Debian netinst ISO: Download the Debian 12 netinst ISO from the Debian download page if not using the included one
-
SSH key pair: Generate or use an existing key pair for Ansible automation
Run the assemble_preseed_iso.sh
script to create a customized installation ISO. The script will:
- Extract the contents of the source Debian ISO
- Inject your preseed configuration and SSH key
- Create a new bootable ISO configured for UEFI/GPT systems
- Generate an ISO that performs a completely unattended installation
The script accepts the following options:
Usage: ./assemble_preseed_iso.sh [options]
Options:
-i, --iso PATH Source ISO file path (default: ./debian-12.10.0-amd64-netinst.iso)
-g, --grub PATH Custom GRUB config file (default: ./grub.cfg)
-p, --preseed PATH Custom preseed file (default: ./preseed.cfg)
-k, --key PATH SSH public key to include (default: ~/.ssh/id_rsa.pub)
-o, --output PATH Output ISO path (default: ./debian-12-preseed.iso)
-h, --help Display this help message
Example with custom options:
./assemble_preseed_iso.sh --iso ~/Downloads/debian-12.10.0-amd64-netinst.iso --key ~/.ssh/custom_key.pub
The default configuration targets GPT partitioning with UEFI boot. If your target system has different requirements:
- GRUB Configuration: Modify
grub.cfg
to change boot parameters or support legacy BIOS systems - Preseed Configuration: Edit
preseed.cfg
to adjust:- Partitioning scheme (current setup uses GPT)
- Boot method (UEFI vs. BIOS)
- Package selection
- Network configuration
Both files contain comments explaining the major configuration sections. For legacy BIOS or MBR partitioning, you'll need to modify the partitioning sections in the preseed file.
This preseed setup prepares your systems for immediate Ansible management:
- Initial Access: The default root password is set to
r00tme
during installation, but this is only intended for initial setup on secure networks (LANs, VPCs, or isolated environments) - Secure Management: The preseed process injects your SSH public key, enabling immediate passwordless Ansible access
Your Ansible playbooks should implement these security best practices:
- Change the default root password or disable root password login entirely (if enabled)
- Create proper user accounts with appropriate privileges
- Configure SSH according to your security policies (key-only authentication, non-standard ports, etc.)
This approach allows for zero-touch provisioning while maintaining a clear path to a secure configuration.