Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Phase 4: Hetzner Infrastructure Implementation #28

@josecelano

Description

@josecelano

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 (localdevelopment) 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 and PROVIDER 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

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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions