You could try using Hashicorp’s Packer to generate images repeatably (usually more meant for cloud images though). Or NixOS (like others have mention), or Guix (like NixOS, but better in some ways, worse in others). You could make it an Ansible playbook, which would let you both make configured images, and just configure machines that already have an OS.
I do something similar with archiso, fwiw, but that only works with Arch Linux.
Would you want to change your distribution, or just keep Debian with some tools to automate?