IoC for my homelab using opentofu
  • HCL 61.7%
  • Jinja 35.5%
  • Shell 2.8%
Find a file
2026-05-01 19:09:11 +02:00
ansible feat: add rsync wrapper function for improved backup handling 2026-05-01 12:14:32 +02:00
docs add(TODO): create a TODO list for common packages in ansible common Role 2026-02-18 09:45:55 +01:00
opentofu refactor: all of the opentofu setup into modules and split them up into folders 2026-05-01 19:07:31 +02:00
services feat: enhance OpenClaw configuration with metadata handling and tool guidance 2026-04-24 22:14:51 +02:00
.env.example fix: remove truenas configuration for now since there is no solid API to use 2026-03-27 23:02:30 +01:00
.gitignore feat: enhance llamacpp configuration for chat and embedding modes, update service handling 2026-04-21 23:57:59 +02:00
AGENTS.md docs: add troubleshooting section for ansible ssh failures 2026-03-28 23:54:22 +01:00
README.md refactor: all of the opentofu setup into modules and split them up into folders 2026-05-01 19:07:31 +02:00
Taskfile.yml refactor: all of the opentofu setup into modules and split them up into folders 2026-05-01 19:07:31 +02:00

Infrastructure Monorepo

This repository manages my home lab infrastructure using OpenTofu for provisioning and Ansible for configuration management.

Structure

.
├── opentofu/       # Infrastructure Provisioning (VMs, Storage, DNS)
│   ├── main.tf
│   └── ...
├── ansible/        # Configuration Management (Software, Docker, Mounts)
│   ├── inventory/
│   ├── roles/
│   └── site.yml
└── ...

1. Provisioning (OpenTofu)

The opentofu/ directory contains the Infrastructure as Code definitions for Proxmox.

VM templates use the upstream Debian cloud image. The downloaded image is not overwritten during routine OpenTofu plans, so template refreshes stay explicit and reviewable. New Debian VMs receive cloud-init vendor-data that installs qemu-guest-agent during first boot so Proxmox can use the guest agent without a separate Ansible bootstrap toggle.

Quick Start:

task tofu:init
task tofu:plan
task tofu:apply

Key Resources:

  • VMs: Defined in main.tf and vms-new.tf.
  • Templates: Debian 13 cloud image template.
  • State: Local state file (backed up, git-ignored).

2. Configuration (Ansible)

The ansible/ directory manages the software and configuration inside the VMs.

Prerequisites:

cd ansible
ansible-galaxy install -r requirements.yml

Dynamic Inventory: This project uses the Proxmox dynamic inventory plugin to find VMs. You must export your Proxmox credentials as environment variables before running playbooks:

export PROXMOX_API_ENDPOINT="https://192.168.1.10:8006/"
export PROXMOX_USER="root@pam"
export PROXMOX_TOKEN_ID="your-token-id"
export PROXMOX_TOKEN_SECRET="your-token-secret"

Running Playbooks:

# Verify inventory
ansible-inventory -i inventory/proxmox.yml --graph

# Run the main playbook
ansible-playbook -i inventory/proxmox.yml site.yml

Documentation