Skip to content

vinymeuh/raspi-ansible

Repository files navigation

raspi-ansible

License: MIT

A set of Ansible playbooks to setup and to manage Alpine Linux on my little fleet of Raspberry Pi.

Install Ansible

Assuming Python 3 interpreter is already installed:

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt  

Bootstrapping Alpine Linux installation

Mount the SD Card then use the bootstrap.yml playbook. It will downloads the Alpine Linux distribution, extracts it on the SD Card and performs minimal setup to be able to connect remotely to the Raspberry Pi just after the first boot.

source venv/bin/activate
ansible-playbook bootstrap.yml -e target=pizerow

Eject the SD card and use it to boot the Raspberry Pi.

We should be able to connect remotely as root using ssh to manually (:bow:) finish the Alpine setup.

cd /media/mmcblk0p1
setup-alpine -f setup.answer        # Accept all defaults choices
apk add wpa_supplicant              # If wifi enabled
rc-update add wpa_supplicant boot   # If wifi enabled
rm -f /etc/runlevels/default/bootstrap-*
apk update
apk add python3
lbu commit -d
reboot

After reboot we should be able to ping the Raspberry Pi with ansible:

ansible --one-line -m ping pizerow

About

Ansible playbooks to manage my fleet of Raspberry

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages