Skip to content

Instantly share code, notes, and snippets.

@possebon
Created December 19, 2025 17:51
Show Gist options
  • Select an option

  • Save possebon/d4f844d162f9779a18e88585a9de9bf1 to your computer and use it in GitHub Desktop.

Select an option

Save possebon/d4f844d162f9779a18e88585a9de9bf1 to your computer and use it in GitHub Desktop.
Open Source Infrastructure Stack - 21-infrastructure-file-structure

Infrastructure Repository File Structure

infrastructure/
├── opentofu/
│   ├── main.tf           # Server provisioning
│   ├── secrets.tf        # Infisical integration
│   ├── versions.tf       # Provider configuration
│   └── variables.tf      # Input variables
├── ansible/
│   ├── group_vars/       # Configuration hierarchy
│   ├── playbooks/        # Deployment automation
│   └── stacks/           # Docker Compose templates
└── .env.example          # Bootstrap template

This structure separates concerns: OpenTofu handles cloud resource provisioning, Ansible handles configuration and deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment