This repository was archived by the owner on Oct 10, 2025. It is now read-only.
forked from torrust/torrust-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
Phase 4: Hetzner Infrastructure Implementation #28
Copy link
Copy link
Closed
Description
Objective
Add Hetzner Cloud provider support and validate complete deployment.
This issue implements Phase 4 of the parent issue #3 (Migrate Torrust Tracker Demo from Digital Ocean to Hetzner).
Scope
Implement a multi-provider architecture that properly separates environments from infrastructure providers, ensuring the system can scale to support unlimited providers without code changes.
Design Approach
- Clear Separation: Environment (development/staging/production) vs Provider (libvirt/hetzner/aws/etc.)
- Pluggable Provider System: Each provider self-contained with standard interface
- Scalable Architecture: Adding new providers requires zero changes to existing code
- Zero Breaking Changes: Backward compatibility maintained with default values
Tasks
Core Architecture
- Rename environment files (
local
→development
) to avoid confusion - Create provider interface system (
infrastructure/scripts/providers/provider-interface.sh
) - Implement pluggable provider modules in
infrastructure/terraform/providers/
- Update Makefile to require both
ENVIRONMENT
andPROVIDER
parameters
Hetzner Provider Implementation
- Create Hetzner Cloud OpenTofu provider configuration
- Implement Hetzner-specific Terraform configurations
- Create Hetzner provider script with standard interface functions
- Add Hetzner cloud-init adaptations
- Create provider-specific environment templates
Enhanced Commands
- Add
make infra-providers
- List available providers - Add
make infra-environments
- List available environments - Add
make provider-info PROVIDER=hetzner
- Get provider details - Update all infrastructure commands to use
ENVIRONMENT
+PROVIDER
pattern
Validation
- Test complete deployment pipeline on Hetzner
- Verify all services start correctly
- Test tracker functionality (announce, scrape)
- Confirm firewall rules work correctly
- Performance and connectivity testing
Usage Examples
# Development environment on local infrastructure
make infra-apply ENVIRONMENT=development PROVIDER=libvirt
# Staging environment on DigitalOcean (future)
make infra-apply ENVIRONMENT=staging PROVIDER=digitalocean
# Production environment on Hetzner
make infra-apply ENVIRONMENT=production PROVIDER=hetzner
Implementation Plan
Detailed implementation plan available in: docs/plans/multi-provider-architecture-plan.md
Definition of Done
- Multi-provider architecture implemented with pluggable system
- Hetzner provider working and tested
- All existing commands work with backward compatibility
- No hardcoded provider logic in core scripts
- Complete deployment validated on Hetzner
- Documentation updated
Related Issues
- Parent: Migrate Torrust Tracker Demo from Digital Ocean to Hetzner #3 - Migrate Torrust Tracker Demo from Digital Ocean to Hetzner
- Depends on: Use MYSQL instead of SQLite by default #12 (MySQL), Phase 2: 12-Factor App Refactoring #14 (12-Factor), Phase 3: Complete Application Installation Automation #21 (Automation) - all completed
Provider Firewall Consideration
- VM firewall via cloud-init: ✅ Required
- Provider firewall: 🤔 Optional additional security layer
Deliverable
Working Hetzner deployment with IP access and clean multi-provider architecture that scales to unlimited providers.
Metadata
Metadata
Assignees
Labels
No labels