I have a use-case where we need to distribute many industrial personal computers (basically rugged mini-pcs) to a number of locations around the world. These computers must all be configured the same way with Ubuntu Desktop and some packages, script and common credentials pre-installed so that when they ping home over the internet, they can self-provision to our IoT management platform.
What are the best practices and tools you could recommend for me to do this? I understood from other questions that clonezilla or dd could be used to copy a pre-configured OS to an image, but I don't yet understand how I could automatically flash target devices without human interaction in a way that would also allow me to later remotely re-flash them with an updated ISO when they are in the field.
The question that was said to be similar does not cover this use-case because it was about an IT environment and an operator would manually use the cloned image and install it. I need an image that the factory can flash to hundreds, potentially thousands of edge computers and I need a way to "update" that flashed OS once the devices are installed on-site by re-flashing the whole OS image to a new prebuilt image e.g. in case of some security updates. For maintenance purposes, its not viable to ssh to each machine and manually run apt upgrade on it, as it would cause the installations to drift from each other.
We have previously used double boot partitions where a new image could be written to second one and then it was swapped on boot (application files were mounted from another partition to /mnt). However that was on a custom headless industrial device with custom linux distro built with buildroot. How to do this automatically with Ubuntu does not seem to be easily searchable...