Bulk provisioning setup is used when provisioning hundreds or thousands of devices from the same OS image
You shouldn't just clone an image that has Synpse agent already initialised as each device needs to have its own device ID, which is set on initial install. It's important that we install Synpse on the first boot, and not pre-install it before cloning the disk. Read on for an example of how to do so.
If you haven't dealt with bulk provisioning before, here's a workflow you can use to get yourself set up. It involves:
- 1.Downloading and booting into your chosen Linux installation
- 2.Filesystem changes to set up your devices on their first boot (systemd script)
- 3.Cloning the modified disk to multiple drives
After we're done, you'll be able to simply boot the devices and they will register as unique entries in your Synpse dashboard.
To boot a Linux install, pick your distribution of choice, download the image, and write it to your SD card or other medium of choice. Here is how you might do this to install Raspberry Pi OS, a standard distribution built for Raspberry Pis.
Next, plug your disk into your device. For a Raspberry Pi, this would just mean slotting the SD card into the SD card reader. You may also want to attach some peripherals for the following step, such as a keyboard and monitor, so you can interact with the system.
Provision device page gives you project and registration IDs
Use the variables to edit the initial installation script below. Then place this script in
/opt/install-synpse.sh. Once saved in the device, run
chmod +x /opt/install-synpse.shto ensure that the script can be executed.
# Installs Synpse agent
curl --retry 10 --retry-delay 60 \
https://downloads.synpse.net/install.sh | \
# Stops the service only if the previous command was successful!
systemctl disable install-synpse.service
Here's a systemd unit file that we can use to run our one-off script. Let's place this script in
Description=Installs Synpse agent
systemctl daemon-reloadto reload daemon and then run
sudo systemctl enable install-synpse.serviceto enable our new installation service to run on boot!