Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

mkuthan/raspberry-ansible

Repository files navigation

Raspberry PI Configuration

My Raspberry Pi installation at home.

  • Do not touch anything by hand, use Ansible.
  • If something is hard to automate, document it at least.

Hardware

  • Raspberry Pi 4 model B, 4GB
  • HiFiBerry DAC+
  • RAIDON GR3660-B3 (with fan turned off)

hardware

Manual setup

Install image

The repository is tested against Raspberry Pi OS Lite 64 bit (Debian 11 "Bullseye").

  1. Install image on SD card
  2. Append ip=«IP» into cmdline.txt
  3. Enable ssh touch ssh
  4. Configure default user account with pi password echo "pi:vCKtyl9xwqPxU" > userconf

Configuring SSH

Generate key:

ssh-keygen -f pi_rsa

Configure client:

cat <<EOT >> ~/.ssh/config
Host pi
 HostName «IP»
 User pi
 IdentityFile ~/.ssh/pi_rsa
EOT

Copy key to Raspberry Pi:

ssh-copy-id -i ~/.ssh/pi_rsa.pub pi

Ansible playbooks

Install 3rd party roles:

ansible-galaxy install -r requirements.yml

Pimp my Pi playbooks

Various playbooks to improve vanilla Raspberry Pi setup:

ansible-playbook pimpmypi.yml

Roles:

  • common - missing pieces of vanilla Raspberry distribution
  • aria2 - the fastest utility for downloading files
  • docker - Docker repository and packages
  • fluentbit - send systemd logs to GCP Logging and/or Loki, see readme
  • grafana - monitoring with Grafana Cloud (free tier)
  • hdidle - spin-down disks, see Github
  • log2ram - move logs into RAM, see Github
  • posfix - forward mails to real account
  • smartmontools - monitor hard drives

Other playbooks

Upgrade playbook

Upgrade system to the latest Bullseye:

ansible all -m apt -a "upgrade=yes update_cache=yes"

The following packages have versions pinned and needs to updated explicitly:

  • adguard
  • grafana-agent
  • kodi