Infraestrutura como Código do Homelab - Terraform, Ansible, Docker Compose
Go to file
gaia 82fec81eb2 inventory: fill all PLACEHOLDERs with Omada API discovered data
Discovery via Omada Controller API (gitea_client_2 app):
- All 4 network devices (ER605, SG2428P, 2x EAP610) with MAC/IP/firmware
- All 25 clients across VLANs 1/10/20 with MAC/IP/hostname
- Complete VLAN topology, gateways, DHCP ranges, static leases
- Proxmox node IP, VMs (homeassistant), LXC containers (dockerino, media)
- TrueNAS IP and all NFS mount points

Also fixes:
- hestia: gateway 10.0.0.1 (was PLACEHOLDER)
- physical.yaml: proxmox MAC/IP, truenas MAC/IP, ER605 full config
- network.yaml: all VLAN gateways filled (10.0.x.1 pattern)
2026-04-09 16:54:16 -03:00
.gitea/workflows refactor: move docker/ → services/ 2026-04-09 12:13:10 -03:00
gitea-runner chore(gitea-runner): clean up binary/credentials, update docs 2026-04-09 12:12:26 -03:00
inventory inventory: fill all PLACEHOLDERs with Omada API discovered data 2026-04-09 16:54:16 -03:00
services refactor: move docker/ → services/ 2026-04-09 12:13:10 -03:00
.gitignore chore(gitea-runner): clean up binary/credentials, update docs 2026-04-09 12:12:26 -03:00
README.md docs: rewrite README with clean structure and 4-layer architecture overview 2026-04-09 12:44:52 -03:00

Homelab — Infraestrutura como Código

Guardiã: Gaia (Agente Hermes) Dono: João Paulo Ferreira (jp@iamferreirajp.com) Repo: gaia/homelab

Visão Geral

Todo o homelab versionado como IaC — Infrastructure as Code. O objetivo: ter o ambiente completo documentado e reproduzível, do físico ao serviço.

Arquitetura em 4 camadas

inventory/         # Camada 0 — Single Source of Truth (máquinas, IPs, discos)
terraform/         # Camada 1 — Provisão (VMs, pools, rede)
ansible/           # Camada 2 — Configuração de OS
services/          # Camada 3 — Aplicações (Docker Compose)

Inventário

Arquivo Conteúdo
inventory/physical.yaml Máquinas físicas, MACs, IPs
inventory/proxmox.yaml VMs e LXC no Proxmox
inventory/truenas.yaml Discos ZFS, pools, datasets
inventory/network.yaml VLANs, subnets, DNS

Serviços ativos

services/dockerino/       # 11 serviços via Docker Compose
  ├── picsur/            # Galeria de imagens
  ├── adguard/           # DNS + bloqueador
  ├── nginx-proxy/       # Reverse proxy + Let's Encrypt
  ├── outline/           # Wiki colaborativa
  ├── bookstack/         # Wiki/notes
  ├── homer/             # Dashboard
  └── ... (mais)

services/media/          # Jellyfin (media server)

CI/CD — Gitea Actions

Workflows em .gitea/workflows/:

  • picsur.yml — valida e faz deploy do Picsur via SSH no Dockerino

Como funciona o deploy do Picsur

  1. PR aberto → Gitea Actions valida (docker compose config, docker compose pull)
  2. Merge para main → deploy automático via SSH:
    ssh root@10.0.0.50
    rsync -avz services/dockerino/picsur/ /root/dockerino/picsur/
    docker compose up -d
    

Próximos passos

  1. Preencher inventory/ com dados reais do Proxmox e TrueNAS
  2. Configurar Terraform Cloud via API (state versionado)
  3. Migrar deploy do Picsur para ler do inventory (não hardcoded)
  4. Expandir para os outros serviços

Estrutura atual do repo

homelab/
├── .gitea/workflows/       # CI/CD
├── ansible/                 # (em construção)
├── gitea-runner/           # Runner de CI/CD
├── inventory/              # Single Source of Truth
├── services/              # Docker Compose por serviço
│   ├── dockerino/         # 11 serviços
│   └── media/             # Jellyfin
└── terraform/             # (em construção)