We would like to run an automation installation script for adding a new device.
Our manual steps so far are like this:
- Add a new device in the balena cloud
- Download & flush the image with balenaEtcher to the SD of the device
- Start the device & wait for it to boot
- Run script from another PC in the same subnet to generate a certificate for it, and pass it into the container by adding new environment variable.
We would like to automate this process as much as possible.
Is there a way to perform automatically steps (1)-(3) without having to remove the SD from the device? That is we would like it to somehow pull the complete image from cloud & burn it on the device directly, a single script to do it all without manual intervention.
For step (4) we need the UUID of the device for balena CLI. I understand we can see it in the cloud, I’m wondering if there is a way to identify a device automatically, like a device which is connected to the same subnet network as the PC from which the installation script is executed?
balena scan shows only devices in development mode, not in production mode.