This repo contains Ansible playbooks for automated provisioning and deployment of piledbox to Raspberry Pi 5 units.
Project repo: https://github.com/fabio-rinaldo/piledbox.git
The following playbooks are provided:
-
playbooks/make-sd-card.yaml: Downloads Raspberry Pi OS image, burns it to SD card, and pre-configures it -
playbooks/rpi-deploy.yaml: Connects to a Raspberry Pi via SSH to configure it and deploy piledbox -
playbooks/rpi-update.yaml: Connects to a Raspberry Pi via SSH to update piledbox to the latest version
On your local machine (control node) you need the following installed:
ansiblesshpass(for initial SSH authentication with password)rpi-imagerCLI tool for RPi microSD card imaging
Install prerequisites:
# Debian/Ubuntu
sudo apt install ansible sshpass rpi-imagerAs well as of course a microSD card reader.
Edit inventory/group_vars/all.yaml if you wish to configure:
- RPi locale settings
- RPi administrator user name
Create secrets file from the template:
cp inventory/host_vars/imager/secrets.yaml.template inventory/host_vars/imager/secrets.yamlEdit it with your desired wifi credentials and hashed admin user password.
Generate a new hashed password with:
mkpasswd -m yescryptCreate a piledbox configuration file from the template:
cp roles/server/files/config.yaml.template roles/server/files/config.yaml Edit config.yaml to suit your installation. This file will be deployed to the Raspberry Pi.
This playbook prepares a bootable SD card with Raspberry Pi OS (Trixie), pre-configured with locale settings, WiFi, SSH, and user accounts.
ansible-playbook playbooks/make-sd-card.yaml -KYou will be asked for your local user sudo password (required to flash the microSD card).
Then follow the on-screen instructions.
- Unmount the SD card
- Insert into Raspberry Pi and power on
- Wait ~2 minutes for first boot and cloud-init to complete
- The Pi should connect to your WiFi network automatically
Run this playbook to connect to the Raspberry Pi via SSH, configure it and deploy piledbox.
Prerequisites:
- microSD card prepared with previous playbook
- Raspberry Pi powered on and connected to network
ansible-playbook playbooks/rpi-deploy.yaml -K -kYou will be asked to enter the RPi administrator user password.
Then follow the on-screen instructions.
Note: You may be prompted to reboot the Pi during deployment to apply some changes.
If you wish to update piledbox to its latest release, run the following:
ansible-playbook playbooks/rpi-update.yaml -K -kYou can SSH into the RPi as the admin user.
This workflow deploys the following:
- set RPi hostname to
piledbox.local - user
piledboxto run the systemd service - group
piledbox - adds user
adminto grouppiledbox - app configuration file stored in
/etc/piledbox/config.yaml - installs
piledboxfor both usersadminandpiledbox - systemd service
piledbox - systemd timer
piledbox-bootto start service 30 seconds after boot
You can start/stop the app manually via systemctl:
sudo systemctl start piledbox
sudo systemctl stop piledbox