Infrastructure as Code.
This project installs and configures Arch Linux, Debian or Ubuntu operating systems fully automated.
⚠ Make sure to create a
.env
file and reference to the correct code branch with the env vars in it!
Features:
- 💿 Build the installer ISO image in a Docker environment
- 💡 Read hostname and OS type from UEFI variables or use cloud-init
- 🔨 Install a minimal Arch Linux OS, Debian OS or Ubuntu OS
- ❓ Decide target disk for installation, etc by hostname
- 🔐 Setup root password, SSH keys and user accounts
- 🚀 Autostart OS configuration at first boot
- 💻 Autostart Desktop configuration at first Desktop logon
- ⏱ From blank disk to booted system in ~15 Minutes
Workflow base installation & hostname based configuration:
graph LR
build["Build<br>ISO"] --> boot["Boot<br>ISO"]
boot --> bootstrap["Run<br>bootstrap"]
bootstrap --> reboot1["Reboot into<br>new OS"]
autorun1["Autorun host<br>playbook on<br>first boot<br>(Install OS components)"]
autorun1 --> reboot2["Reboot"]
reboot2 --> xfce["Boot into<br>XFCE4"]
xfce --> autorun2["Run host<br>playbook on<br>first XFCE Login<br>(Configure XFCE4)"]
autorun2 --> logout["Logout<br>to load<br>XFCE settings"]
logout --> done["Done!"]
selfsignedcert
role is not idempotent
All packages are installed from the official sources.
- bash
- systemd
- systemd-networkd (DHCP on all ens* interfaces)
- systemd-timesyncd
- systemd-resolved
- net-tools + dnsutils
- nano + vim
- curl + wget
- Ansible
OS | #Packages | #Processes | Size | Memory |
---|---|---|---|---|
Ubuntu 24.04 "Noble" | ~390 | 14 | 2.5GB | 280MB |
Debian 12 "Bookworm" | ~390 | 14 | 2.2GB | 270MB |
Arch Linux | ~170 | 20 | 2.7GB | 300MB |
Archiso is used as a base for the Installer ISO. archiso/ contains a Dockerfile and some scripts to build a custom Arch Linux installer ISO with additional scripts.
./archiso/build.sh
builds the container image./archiso/pack.sh
runs the container image to build the Arch Linux ISO image- ISO Image can be found in
./archiso/output/
Requires Docker CE, pack.sh
executes a container in privileged mode.
Works with terraform, to be documented here.
The perrys-bootstrapper.sh
script is using UEFI variables to fetch the hostname from the system and use the
correct ansible inventory variables.
Set hostname in UEFI variable:
echo -n myhostname > efi-hostname
efivar --name ed38a5bf-1135-4b0f-aa72-49d30b05dfd4-PerryHostname -w -f efi-hostname
Get the hostname from UEFI variable:
cat /sys/firmware/efi/efivars/PerryHostname-ed38a5bf-1135-4b0f-aa72-49d30b05dfd4
In addition the variable PerryFlavor-ed38a5bf-1135-4b0f-aa72-49d30b05dfd4
can be used to
set the flavor (debian
or archlinux
).
- Build the Arch Linux ISO image
- Boot ISO in a virtual machine or on a physical system
- Ensure that the
diskdev
andbootmode
are correct in the inventoy - Run installer
- Debian:
perrys-bootstrapper.sh --flavor debian --hostname biostest
- Arch Linux:
perrys-bootstrapper.sh --flavor archlinux --hostname biostest
- Debian:
- Reboot into the new OS
The bootstrapparameters
in the Ansible inventory decide which hostname uses which settings.
bootmode
: One ofuefi
orbios
diskdev
: For example/dev/sda
firstbootplaybook
: Boolean, running host-specific playbook on first boot?networking
: One ofnetwork-manager
orsystemd-networkd
encryptedfs
: Boolean, encrypt the root filesystem?
Run perrys-ansible-apply.sh
as root.
It pulls automatically the correct playbook from this repo by the hostname of the operating system.
Every role was created for a specific case and may support only a single OS, please see task code and readme file.