Skip to main content
Ansible Configuration and Setup
Overview

Ansible Configuration and Setup

1 min read

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_rsa
EOT
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:

Terminal window
REPLACE_this_with_your_nfs_server_ip_address

Replace the share path:

Terminal window
REPLACE_this_with_your_nfs_path

The final line should look like this:

Terminal window
172.20.0.254:/volume1/Server/Data/media_nas/ /media nfs rw,hard,intr 0 0
Warning

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.

Share this post