The Raspberry Pi 2B I bought many years ago has lived many lives. It's been a video game console, a media center, a synthesizer, and in its most dutiful incarnation a print server. I am cheap and decided I did not want a newer 64-bit Pi. This one should do fine, right? ... Right? Well not without headaches. This is an adaptation of a haxor.no article but updated to reflect changes present in the Bookworm and Trixie releases of Debian/Armbian/PiOS.
The card selected must be 8GB or higher and from a quality brand. That's all I'll say. Do your own research on why this is true. Knockoff SD cards are known to fail. You get what you pay for, basically.
After flashing the SD card with a fresh Pi OS, the package configuration blue screen will appear.
Setting the Keyboard layout correctly is more important than you might think, else you'll have a lot of trouble typing the " character later on.
Don't use the default username of "pi" like we did in the old days. Newer versions of PiOS isntead force you to create a username of your own. This is a good thing.
You'll have a chance to type in a password and confirm that you didn't mess it up. Put this in a password manager like KeePass.
The first login is complete, and the next obvious step is to set up WiFi. Every WiFi documentation article out there is wrong since the release of Bookworm. The correct tool to use is nmtui. Run it and begin setup
This is where you turn on the WiFi antenna. In my case, The 2B did not come with an antenna of its own and I use a tiny USB 2.4GHz WiFi thingy. That's what it's officially called, yes. If you don't see this option, it means your version of PiOS is too old. Trash it and start over. I wasted a lot of time after an apt upgrade to an older install which didn't have the radio option for some reason. If this happens to you, don't waste any more time; just trash the OS and start fresh.
For my print server I like to set the name to printypi to let myself know this is the Pi meant for printing. It will save a little bit of time later on too.
I chose the WiFi SSID from a scanned list. This is pretty easy! The first time connecting, it will take a second and then prompt for the password like you'd expect. if all goes well, you're online.
Run sudo raspi-config to set up SSH.
- Interface Options
- SSH
- Yes
After running sudo reboot the cloud-init-network.service should show all your connections and at the end of all the text report My IP address is 192.168.x.xxx.
Log in again and you should see <username>@printypi:~$
The rest of the guide will be done from SSH.
Ensure you're on the same WiFi SSID and then try this:
ping printypi.local
Press Ctrl+C when you've seen a few packets send successfully.
Set up the Pi with your public SSH key. This isn't just about avoiding trying in your password. Ansible will need this.
ssh-copy-id <username>@printypi.local
Most other guides will drag you through a lot more things to type in...but not this one! We're going to automate the rest of set-up with Redhat Ansible. This will be awesome especially because if you find any mistakes or necessary changes that this guide doesn't cover after I publish it, updating the playbook will automatically remove unnecessary bits and add necessary bits cleanly.
Version mismatches may cause the next steps to fail. You can check with ansible --version if you've already got it. Version 2.14 or lower isn't high enough for Trixie. To install/upgrade ansible to the newest version:
pip install --user ansible
Change the ansible_user field to use the pi user name
To convert your Pi into a print server just run the following which will install and configure cups
ansible-playbook -i inventory.yml printypi.yml