https://github.com/clayshek/raspi-ubuntu-ansible
Ubuntu Raspberry Pi provisioning (lab use), using Ansible pull from Git
https://github.com/clayshek/raspi-ubuntu-ansible
ansible ansible-pull homelab raspberry-pi raspberry-pi-3 raspberry-pi-4 raspberrypi raspi ubuntu
Last synced: about 1 year ago
JSON representation
Ubuntu Raspberry Pi provisioning (lab use), using Ansible pull from Git
- Host: GitHub
- URL: https://github.com/clayshek/raspi-ubuntu-ansible
- Owner: clayshek
- Created: 2020-06-04T18:25:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-20T17:31:59.000Z (over 1 year ago)
- Last Synced: 2025-04-09T23:15:39.716Z (over 1 year ago)
- Topics: ansible, ansible-pull, homelab, raspberry-pi, raspberry-pi-3, raspberry-pi-4, raspberrypi, raspi, ubuntu
- Language: Smarty
- Homepage:
- Size: 99.6 KB
- Stars: 67
- Watchers: 5
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# raspi-ubuntu-ansible
Raspberry Pi Ubuntu lab provisioning with Ansible
# Overview:
Repo contains necessary files to provision multiple Ubuntu Raspberry Pi in home lab. Each Pi SD card is flashed with the latest Ubuntu Server image for Ras Pi, and a user-data file with customized config (Ctrl-Shft-X in Raspbery Pi Imager) is copied to boot partition. Once booted, cloud-init with the custom user-data file will set the hostname, create a personalized user with associated ssh key (and locked password), and call ansible-pull to run the playbooks from this repo.
Ansible will further configure host networking (based on assigned hostname and assigned role & variables), setting IP, netmask, gateway, DNS server(s), and DNS search suffix(es) by creating a host-specific [Netplan](https://ubuntu.com/server/docs/network-configuration) file from the included template. Ansible will, based on assigned role, install additional packages.
# Usage:
- Flash Raspberry Pi SD card with desired [Ubuntu Server version](https://ubuntu.com/download/raspberry-pi) - successfully tested on v24.04.1 LTS.
- Copy user-data to boot partition of SD card (first customize hostname value, which should be reflected in Ansible inventory.yml file and have a .yml variables file in host_vars, do any user/ssh key modifications as necessary, and update Git repo location as appropriate)
- Boot Raspberry Pi, after a few minutes, Pi should be provisioned (depending on Pi model and RAM, cloud-init / Ansible run could take 25+ minutes)
- Watch 'cloud-init status'. Troubleshoot logs at /var/log/cloud-init-output.log & /var/log/cloud-init.log.