Add Hetzner Cloud as the first production infrastructure provider for the Torrust Tracker Deployer.
The main feature specification including:
- Overview and problem statement
- Feature goals
- Proposed solution
- Implementation details
- Definition of done
- Testing strategy
Clarifying questions that need to be answered before implementation:
- Scope and requirements
- Technical approach
- Priority and timeline
- Success criteria
- Risk assessment
Technical analysis of the current implementation and proposed changes:
- Current LXD provider implementation analysis
- Provider abstraction strategy
- Implementation approach for multi-provider support
Current Phase: Planning Complete - Ready for Implementation
Completed:
- ✅ Create feature specification
- ✅ Create questions document
- ✅ Create analysis document
- ✅ Answer clarifying questions (all 21 questions answered)
- ✅ Update specification based on answers
- ⏳ Begin implementation
Next Steps:
- Create issues for Phase 1 (LXD explicit provider refactoring)
- Implement Phase 1 incrementally
- Manual E2E testing with Hetzner (token provided by product owner)
Problem: The deployer currently only supports LXD as a hardcoded provider. LXD was chosen for development and testing, but for production deployments (like the Torrust Tracker Demo), we need cloud provider support.
Solution: Implement a multi-provider architecture starting with Hetzner Cloud as the first production provider. The approach is to:
- Phase 1: Refactor to make LXD an explicit, selectable provider
- Phase 2: Add Hetzner provider alongside LXD
Key Design Decisions:
- No provider abstraction layer: Each provider uses its own native configuration (Terraform/OpenTofu variables) without a common abstraction
- Provider selection via environment config: User specifies provider in the environment JSON file (no default - always explicit)
- OpenTofu templates per provider: Separate template directories for each provider (
tofu/lxd/,tofu/hetzner/) - Rust-based validation (MVP): Serde tagged enums handle provider-specific validation. JSON Schema generation is a future enhancement, not MVP.
- Single-use tool philosophy: This is a deployment tool, not a management platform. All config (including API tokens) stored in environment JSON. Users responsible for securing local data.
- OS-level firewall only: Use UFW instead of provider firewalls (Hetzner Cloud Firewall) for portability across providers
InstanceNamegeneric,ProfileNameLXD-specific: Instance name uses strictest validation across all providers; profile name moves to LXD-specific config- Local Terraform state only: No remote state backends - not a team/multi-user tool
A working Hetzner Terraform configuration exists in the bash Proof of Concept:
- Repository: torrust/torrust-tracker-deploy-bash-poc
- Hetzner Provider: infrastructure/terraform/providers/hetzner/
This PoC implementation provides:
main.tf- Hetzner firewall and server resources with cloud-initvariables.tf- Server type/location/image definitions with validationoutputs.tf- Standard output interface compatible with our parserversions.tf- Required provider versions (hcloud ~> 1.47)