Skip to content

Reproducible configuration for home servers using Ansible and Docker

Notifications You must be signed in to change notification settings

adamayd/HomeServers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Home Server Configurations

Hardware

  • Raspberry Pi 4
  • Cana-kit Case, heatsinks, and fan

Software

  • Raspberry Pi OS Lite
  • Ansible
  • Docker

Containers

  • TP Link Omada Controller Software
  • Pi-Hole

Initial Setup

touch ssh on boot partition to enable ssh on boot

rename the host in etc/hostname (NOTE: no forward slash) in the rootfs partition if you want a different hostname at boot.

Creating Users

On the ansible client, create an ansible user without a password (this prevents ssh authentication to the ansible control node). This may not work on desktop linux if users are required to have a password for the account to be enabled.

sudo useradd ansible

SSH into the RPi and create an ansible user with a password (this allows for the user to invoke sudo)

sudo adduser ansible

While still on the RPi we need to add a line to the sudoers file. First set the editor to vim with two commands.

sudo apt remove nano
select-editor

Then add the following line with sudo visudo command.

ansible ALL=(ALL) NOPASSWD: ALL

Setting up ssh keys

As your client/control node ansible user, run ssh-keygen to create the keys. I've used my local user and have created a different file name from the default id_rsa.

Use ssh-copy-id to copy the .pub file to the Raspberry Pi

ssh-copy-id -i <PATH_TO_KEY_FILES>.pub <USER>@<HOSTNAME_OR_IP>

Run Docker Playbook

Remove Stress on SD Card

remove swap

sudo dphys-swapfile swapoff sudo dphys-swapfile uninstall sudo apt purge dphys-swapfile

log2ram

About

Reproducible configuration for home servers using Ansible and Docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published