A set of scripts to set up a DoESLiverpool DoorBot.
DoES Liverpool has three types of doorbot. Most of the basics are shared between them all, and that is all contained within the base-doorbot role. Other roles, such as the one running a web browser for doorbot1, are layered on top of that.
- Install Ansible on your computer
- Using the Raspberry Pi Imager install the latest 32-bit (I think John had trouble with the RFID code on the 64-bit) OS (needs updating for the headless ones, I used the desktop one as it was
doorbot2that I was fixing, but I think we'd want "Raspberry Pi OS Lite"), and edit the settings to configure:- hostname
- password
- SSID
- WiFi password
- Enable the ssh service (use password authentication) (this didn't actually seem to set any of those options when I just tried it, and I had to do them manually with a screen and keyboard when the Pi first booted up)
- Boot the Raspberry Pi with the micro-SD card, while plugged into a network via Ethernet
- Find out the IP address of the Raspberry Pi
- Use nmap (eg:
nmap -p 22 10.0.*.* --open), router or monitor to find IP address of Pi once booted.
- Copy your SSH credentials onto the Pi
ssh-copy-id pi@<ip-address-of-the-pi> - Edit the
./hostsfile so ansible knows which computer to configure. Change the IP address in it to match the one you just found out. - Check you can run commands on the Pi using Ansible
ansible <doorbotN> -i hosts -a "hostname" -u pi - Create the hashed password file to use in a moment (if you don't already have it). At the prompt, provide the relevant password for the doorbot
mkpasswd --method=sha-512 > protected_scripts/doorbot1-pwd.txt - Change the SSH port and default password on the doorbot
ansible-playbook ssh-config-doorbot1.yml -e pi_password=`cat protected_scripts/doorbot1-pwd.txt` -i hosts - Populate
protected_scripts/id_ed25519andprotected_scripts/id_ed25519.pub, most likely by copying contents from an existing doorbot. - Update the Pi, using the correct playbook for the doorbot you're creating, e.g.
ansible-playbook doorbot1.yml -i hosts