Skip to content

lordthorzonus/homelab-provisioning

Repository files navigation

Homelab Provisioning

Available ansible playbooksTerraformHome AssistantNetworkKubernetes Manifests

This repository contains the ansible playbooks, terraform modules and kubernetes manifests to provision my home network environment. Ansible vault files that contain secrets haven't been committed to the public repo.

Quickstart

First install the tools needed

brew install --cask 1password/tap/1password-cli
brew install ansible
brew install terraform
brew install kubectl
terraform init
terraform apply -var-file="prod.tfvars"
ansible-galaxy install -r requirements.yml
ansible-playbook -i inventory.ini provision-homelab.yml

Overview

  • PFsense is managed by hand
  • Unifi equipment is managed by hand
  • Terraform spins up all VMs
  • Ansible is used for provisioning those + other computers and bootstrapping the k3s cluster
  • ArgoCD deploys everything under ./kubernetes

Network

See the documentation here

Hardware

  • Intel NUC i3-8109U/16Gb RAM/480Gb running Proxmox
  • AMD Ryzen 3700 NAS running Proxmox with 21Tb of usable space
  • Raspberry PI 3b+ running Raspberry Pi OS
  • Netgate SG-3100 with Pfsense as router/firewall/dns/vpn
  • Unifi access points and switches

Home Assistant

The Home Assistant instance currently runs on a VM inside a proxmox in a intel nuc, with a friend mqtt gateway running on a old Raspberry PI 3b+.

The configurations can be found roles/home_assistant. Most of the integrations are through MQTT whenever it's available. Overview of connections

InfluxDB is used for long time data storage of the sensor data.

Home Assistant VM

Gateway computer

Devices/Integrations in use

  • Sensors
    • Xiaomi Aqara water and door/window sensors
    • Xiaomi Miio illuminance sensor
    • Netatmo weather station
    • Aeotec motion sensors
    • RuuviTags
    • MiFlora Flower Care sensors
  • Energy
    • Shelly plug S for monitoring energy usage and remote control of some devices
    • Home Assistant Glow for energy monitoring
  • Lights
    • Philips hue lamps for everything inside
    • Ledvance smart+ outdoor plug for Balcony lights
  • Google
    • Nest hub as a command center, tts target and voice assistant
  • Media
    • Samsung Q8 Smart TV
    • Denon X3400H AVR network receiver
  • Vacuum
    • Roborock S7

Terraform

Running

Set the proxmox variables

cp example.tfvars prod.tfvars
terraform init
terraform plan -var-file="prod.tfvars"
terraform apply -var-file="prod.tfvars"

Ansible

The inventory.ini is updated manually for now. So run first the terraform if you are provisioning new servers and modify inventory.ini after that.

Running

First remember to

ansible-galaxy install -r requirements.yml
ansible-playbook playbooks/your-playbook.yml -i inventory.ini

Available playbooks are in ./playbooks

Kubernetes

Bootstrapping a new cluster

  • Use terraform to spin up the k3s nodes.
  • Run ansible-playbook playbooks/bootstrap-k3s-cluster.yml -i inventory.ini for boostrapping the cluster
  • ArgoCD will deploy the rest

About

Playbooks for provisioning my home network

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages