Kacper Leśniara's Ansible Playbook Sets Up Your Raspberry Pi in a Single Command

Designed to automate the drudgery of getting a new Raspberry Pi set up just so, this configurable Ansible playbook is a one-shot command.

Gareth Halfacree
12 months agoProductivity

Data scientist Kacper Leśniara has turned to technology to ease the process of setting up a shiny new Raspberry Pi single-board computer exactly how he likes it — creating a one-shot Ansible script to do the hard work for him.

"Set up your RPI from scratch with only one command," Leśniara promises of his creation, which aims to make deploying a new Raspberry Pi less arduous. "[These are the] Ansible tasks needed to setup the following modules on [Raspberry Pi OS]: periodical auto-upgrade; bigger swap; git config; secure SSH and generate key; ZeroTier; pyenv; CUPS and AirSane for printers; Docker; [and] personal projects."

Technically speaking there's nothing to stop anyone doing any of the above manually, but Leśniara's Ansible playbook automates the process. Ignoring the requirement to install Ansible itself, which admittedly adds an extra step to the process, getting everything set up just so is a single command: ansible-playbook -i inventory.yml main.yml -vv.

There are aspects of the setup, even excluding installation of Leśniara's personal projects, which you may want to skip — setting up a Python version management too isn't much use if you're not a Python developer, for instance, and you may not need the secure remote access provided by ZeroTier — but Leśniara's playbook is entirely customizable, making it easy to tailor the installation and configuration process for your personal needs.

Leśniara has published the playbook, and a guide to its use, on GitHub under the permissive MIT license; it has been tested on the latest Raspberry Pi OS 64-bit running on a Raspberry Pi 3 Model B+, though should be compatible with any Debian-based distribution on any Raspberry Pi model.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles