This covers the Ansible side of the homelab automation — inventory generation, service roles, and optional NFS mount configuration.
Inventory
The inventory folder holds the inventory.ini file that maps the VM’s IP and SSH credentials for Ansible. You don’t touch this manually — Terraform generates it automatically during deployment:
resource "local_file" "ansible_inventory" { depends_on = [time_sleep.wait_1_minute]
content = <<EOT[docker]docker-01 ansible_host=IP_DEPLOYMENT ansible_user=root ansible_ssh_private_key_file=~/.ssh/id_rsaEOT
filename = "../ansible/inventory/inventory.ini"}Roles
The roles/docker folder contains playbooks for installing and configuring Docker, Docker Compose, Portainer, Homepage, and Traefik. Each service has its own .yml file.
NFS Mount (Optional)
If you’re mounting an external NFS share, edit roles/nfs_mount with your values.
Replace the NFS server address:
REPLACE_this_with_your_nfs_server_ip_addressReplace the share path:
REPLACE_this_with_your_nfs_pathThe final line should look like this:
172.20.0.254:/volume1/Server/Data/media_nas/ /media nfs rw,hard,intr 0 0Warning
If you’re not using NFS, comment out the NFS mount block in Terraform. This is covered in the Infrastructure Setup guide.
Next Steps
Proceed to the Services Configuration guide.