This repository contains a Butane config, which can be used to quickly and easily bring up a Pi-Hole machine running on Fedora CoreOS.
- QEMU for validating your config inside a VM.
- Fedora Media Writer for writing the final ISO to boot media.
- Ensure you have the dependencies installed first.
- Clone this repo:
git clone https://github.com/cheesesashimi/burnt-pi
.
- Download the latest stable
.qcow2.xz
FCOS image:$ coreos-installer download --stream stable --platform qemu -f qcow2.xz
. - Extract the qcow2 image from the
.xz
archive:$ xz -d fcos.qcow2.xz
- Edit the
pihole-butane.yaml
file to your liking. In particular, you may want to add your public SSH key and change the timezone. - Run
run-in-qemu.sh ./fcos.qcow2
. Note: Assuming you've added your SSH key to your Butane config, you can SSH into your QEMU VM by running$ ssh core@localhost -p 2222
. You can also bring up the Pi-Hole management page by openinghttp://localhost:8080
in your web browser. - When you shut down your QEMU VM, all state inside will be deleted.
Once the config is set up to your liking, the next step is to prepare a customized boot ISO:
- Download the latest FCOS
.iso
image:$ coreos-installer download --stream stable --platform metal -f iso
. - Run
prepare-iso.sh ./fcos.iso
. - This will create a file called
burnt-pi.iso
which has the rendered Ignition config baked into it. - Use your favorite disk image utility to write this ISO to a USB flash drive or memory card (i.e.,
$ dd if=burnt-pi.iso of=</dev/sd*> bs=1024k status=progress
, or Fedora Media Writer). - Boot your host using the USB flash drive or memory card. The Fedora CoreOS installer will run Ignition against the configuration you've baked into the ISO and then "pivot" into the booted system with Pi-Hole running.
- I've only tested this using the FCOS AMD64 image. That said, FCOS has an officially supported RPi4 image that should work as well, modulo a few RPi4-specific configuration tweaks I'm unaware of at the moment.
- Pi-Hole is managed using a systemd service, which runs the official Docker Pi-Hole container image in the Podman container runtime.
- The configuration leverages Podman's ability to run a Kubernetes Pod locally. This replaces the
docker-compose.yml
file that Docker Pi-Hole uses. - All of the environment config knobs that Docker Pi-Hole understands can be leveraged by the aforementioned Kubernetes Pod spec, which is inlined into the
pihole-butane.yaml
config.