โ ๏ธ DEVELOPMENT STATUS: Early Production PhaseThis project is in active development with initial cloud provider support now available.
Current Scope:
- โ Local LXD virtual machine provisioning
- โ Hetzner Cloud support for production deployments
- โ Development and testing workflows
- โ Multi-provider architecture (provider selection via configuration)
- โ Application deployment (Torrust Tracker stack with Docker Compose)
๐ MVP Goal: After completing the roadmap, we will have a fully automated deployment solution for Torrust Tracker with complete application stack management and multi-cloud provider support.
This Rust application provides automated deployment infrastructure for Torrust tracker projects. It supports local development with LXD and production deployments with Hetzner Cloud. The multi-provider architecture allows easy extension to additional cloud providers.
Current Development Phase:
- โ Create local VMs supporting cloud-init for development and CI testing
- โ Test cloud-init execution and verification in controlled environments
- โ Support Docker Compose inside VMs for application stacks
- โ Fast, easy to install and use local development solution
- โ No nested virtualization dependency (CI compatibility)
- โ Multi-provider support (LXD for local, Hetzner Cloud for production)
- โ Application stack deployment (Torrust Tracker with Docker Compose)
Future MVP Goals: (See roadmap)
- ๐ Additional cloud providers (AWS, GCP, Azure)
- ๐ Multi-environment management
- ๐ Enhanced observability (monitoring, alerting, metrics)
This repository uses LXD virtual machines for local virtualization and development:
- Technology: Virtual machines with cloud-init support
- Status: โ Production-ready for local development and CI testing
- Best for: Local development, CI/CD environments, fast iteration
- Requirements: No special virtualization needed
๐ See detailed documentation โ
๐ See detailed comparison โ
| Feature | LXD Virtual Machines |
|---|---|
| GitHub Actions Support | โ Guaranteed |
| Nested Virtualization | โ Not needed |
| Boot Time | โ Fast (~5-10s) |
| Resource Usage | โ Efficient |
| Installation | โ Simple setup |
This is a Rust application that automates deployment infrastructure using OpenTofu and Ansible.
The project provides a dependency installer tool that automatically detects and installs required dependencies:
# Install all required dependencies
cargo run --bin dependency-installer install
# Check which dependencies are installed
cargo run --bin dependency-installer check
# List all dependencies with status
cargo run --bin dependency-installer listThe installer supports: OpenTofu, Ansible, LXD, and cargo-machete.
For detailed information, see ๐ Dependency Installer โ.
If you prefer manual installation or need to troubleshoot:
Check installations:
lxd version && tofu version && ansible --version && cargo --versionMissing tools? See detailed installation guides:
Quick manual install:
# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install LXD
sudo snap install lxd && sudo lxd init --auto && sudo usermod -a -G lxd $USER && newgrp lxd
# Install OpenTofu
curl -fsSL https://get.opentofu.org/install-opentofu.sh | sudo bash
# Install Ansible
sudo apt install ansibleThe main application provides usage instructions:
# Build and run the application
cargo run
# Or install and run directly
cargo install --path .
torrust-tracker-deployerFor detailed usage instructions, command reference, and examples, see the ๐ค User Guide.
The application includes comprehensive logging with configurable format, output mode, and directory. See ๐ Logging Guide for details on logging configuration options.
This project includes convenient scripts for common development tasks:
# Run all linters (markdown, YAML, TOML, shell scripts, Rust)
cargo run --bin linter allOr run individual linters:
cargo run --bin linter markdown # Markdown linting
cargo run --bin linter yaml # YAML linting
cargo run --bin linter toml # TOML linting
cargo run --bin linter cspell # Spell checking
cargo run --bin linter clippy # Rust code analysis
cargo run --bin linter rustfmt # Rust formatting check
cargo run --bin linter shellcheck # Shell script linting๐ See linting documentation โ
Use the E2E test binaries to run automated infrastructure tests with hardcoded environments:
# Run comprehensive E2E tests (LOCAL ONLY - connectivity issues in GitHub runners)
cargo run --bin e2e-complete-workflow-tests
# Run individual E2E test suites
cargo run --bin e2e-deployment-workflow-tests # Configuration, release, and run workflow tests
cargo run --bin e2e-infrastructure-lifecycle-tests # Infrastructure provisioning tests
# Keep the test environment after completion for inspection
cargo run --bin e2e-complete-workflow-tests -- --keep
cargo run --bin e2e-infrastructure-lifecycle-tests -- --keep
# Use custom templates directory
cargo run --bin e2e-complete-workflow-tests -- --templates-dir ./custom/templates
# See all available options
cargo run --bin e2e-complete-workflow-tests -- --help
โ ๏ธ Important Notes:
- E2E tests create hardcoded environments with predefined configurations
- Use
--keepflag to inspect generateddata/andbuild/directories after testse2e-complete-workflow-testscan only run locally due to connectivity issues in GitHub runners- To see final OpenTofu and Ansible templates, check
build/directories after running with--keep
โ Complete deployment workflow is now available! You can create, provision, configure, test, deploy, run, and destroy Torrust Tracker environments using the CLI.
Current Status:
- โ Environment Management: Create and manage deployment environments
- โ Infrastructure Provisioning: Provision VM infrastructure with LXD or Hetzner Cloud
- โ Configuration: Configure provisioned infrastructure (Docker, Docker Compose)
- โ Verification: Test deployment infrastructure
- โ Application Deployment: Deploy Torrust Tracker configuration and database
- โ Service Management: Start and manage tracker services
Available Commands:
# 1. Generate configuration template torrust-tracker-deployer create template my-env.json # 2. Edit my-env.json with your settings # 3. Create environment from configuration torrust-tracker-deployer create environment -f my-env.json # 4. Provision VM infrastructure torrust-tracker-deployer provision my-environment # 5. Configure infrastructure (install Docker, Docker Compose) torrust-tracker-deployer configure my-environment # 6. Verify deployment infrastructure torrust-tracker-deployer test my-environment # 7. Deploy tracker application configuration torrust-tracker-deployer release my-environment # 8. Start tracker services torrust-tracker-deployer run my-environment # 9. Destroy environment when done torrust-tracker-deployer destroy my-environment๐ For detailed command documentation and guides, see:
- Quick Start Guide - Complete workflow walkthrough
- Commands Reference - Detailed guide for each command (coming soon)
- Console Commands - Technical reference
- Advanced: Manual Commands - Manual OpenTofu and Ansible commands (advanced users only)
- Provision: OpenTofu creates and configures VMs with cloud-init
- Configure: Ansible connects to VMs and executes management tasks
- Verify: Automated checks ensure proper setup and functionality
| Phase | Tool | Purpose |
|---|---|---|
| Infrastructure | OpenTofu | VM provisioning and cloud-init setup |
| Configuration | Ansible | Task execution and configuration management |
| Verification | Ansible Playbooks | System checks and validation |
๐ See detailed Ansible documentation โ
The repository includes comprehensive GitHub Actions workflows for CI testing:
.github/workflows/linting.yml- Code Quality - Runs all linters (markdown, YAML, TOML, Rust, shell scripts).github/workflows/testing.yml- Unit Tests - Runs Rust unit tests and basic validation.github/workflows/test-e2e-infrastructure.yml- E2E Infrastructure Tests - Tests infrastructure provisioning and destruction.github/workflows/test-e2e-deployment.yml- E2E Deployment Tests - Tests software installation, configuration, release, and run workflows.github/workflows/test-lxd-provision.yml- LXD Provisioning - Tests LXD VM provisioning specifically
Note: The complete E2E workflow tests (
e2e-complete-workflow-tests) can only be executed locally due to connectivity issues documented indocs/e2e-testing/.
This project follows a structured development roadmap to evolve from the current local development focus to a production-ready deployment solution.
Current Development Status:
- โ Local LXD Infrastructure: VM provisioning, cloud-init, E2E testing
- โ Development Workflows: Linting, testing, CI/CD automation
- โ Foundation Layer: OpenTofu + Ansible + Docker integration
Next Major Milestones:
- ๐ Main Application Commands:
create,deploy,destroy,status - ๏ฟฝ Real Cloud Providers: Starting with Hetzner, expanding to AWS/GCP/Azure
- ๐ Production Features: HTTPS, backups, monitoring stack
โโโ .github/ # CI/CD workflows and GitHub configuration
โ โโโ workflows/ # GitHub Actions workflow files
โโโ build/ # ๐ Generated runtime configs (git-ignored)
โ โโโ e2e-complete/ # E2E complete workflow test runtime files
โ โโโ e2e-deployment/ # E2E deployment test runtime files
โ โโโ e2e-infrastructure/ # E2E infrastructure test runtime files
โ โโโ manual-test-*/ # Manual test environment runtime files
โโโ data/ # Environment-specific data and configurations
โ โโโ e2e-complete/ # E2E complete workflow test environment data
โ โโโ e2e-deployment/ # E2E deployment test environment data
โ โโโ e2e-infrastructure/ # E2E infrastructure test environment data
โ โโโ manual-test-*/ # Manual test environment data
โ โโโ logs/ # Application logs
โโโ docker/ # Docker-related configurations
โ โโโ provisioned-instance/ # Docker setup for provisioned instances
โโโ docs/ # ๐ Detailed documentation
โ โโโ tech-stack/ # Technology-specific documentation
โ โ โโโ opentofu.md # OpenTofu installation and usage
โ โ โโโ ansible.md # Ansible installation and usage
โ โ โโโ lxd.md # LXD virtual machines
โ โโโ user-guide/ # User documentation
โ โ โโโ commands/ # Command reference documentation
โ โ โโโ providers/ # Provider-specific guides (LXD, Hetzner)
โ โโโ decisions/ # Architecture Decision Records (ADRs)
โ โโโ contributing/ # Contributing guidelines and conventions
โ โ โโโ README.md # Main contributing guide
โ โ โโโ branching.md # Git branching conventions
โ โ โโโ commit-process.md # Commit process and pre-commit checks
โ โ โโโ error-handling.md # Error handling principles
โ โ โโโ module-organization.md # Module organization conventions
โ โ โโโ testing/ # Testing conventions and guides
โ โโโ features/ # Feature specifications and documentation
โ โโโ research/ # Research and analysis documents
โ โโโ *.md # Various documentation files
โโโ envs/ # ๐ User environment configurations (git-ignored)
โ โโโ *.json # Environment configuration files for CLI
โโโ fixtures/ # Test fixtures and sample data
โ โโโ testing_rsa* # SSH key pair for testing
โ โโโ tofu/ # OpenTofu test fixtures
โโโ packages/ # Rust workspace packages
โ โโโ dependency-installer/ # Dependency detection and installation
โ โโโ linting/ # Linting utilities package
โ โโโ src/ # Linting implementation source code
โโโ scripts/ # Development and utility scripts
โ โโโ setup/ # Installation scripts for dependencies
โโโ src/ # ๐ฆ Main Rust application source code (DDD Architecture)
โ โโโ main.rs # Main application binary entry point
โ โโโ lib.rs # Library root module
โ โโโ container.rs # Dependency injection container
โ โโโ logging.rs # Logging configuration
โ โโโ bin/ # Binary executables
โ โ โโโ linter.rs # Unified linting command interface
โ โ โโโ e2e*.rs # End-to-end testing binaries
โ โโโ application/ # Application layer (use cases, commands)
โ โโโ domain/ # Domain layer (business logic, entities)
โ โ โโโ provider/ # Provider types (LXD, Hetzner)
โ โโโ infrastructure/ # Infrastructure layer (external systems)
โ โโโ presentation/ # Presentation layer (CLI interface)
โ โโโ adapters/ # External tool adapters (OpenTofu, Ansible, SSH, LXD)
โ โโโ shared/ # Shared utilities and common code
โ โโโ testing/ # Testing utilities and mocks
โ โโโ config/ # Configuration handling
โ โโโ bootstrap/ # Application bootstrapping
โ โโโ e2e/ # End-to-end testing infrastructure
โโโ templates/ # ๐ Template configurations (git-tracked)
โ โโโ tofu/ # ๐๏ธ OpenTofu/Terraform templates
โ โ โโโ lxd/ # LXD VM template configuration
โ โ โโโ hetzner/ # Hetzner Cloud template configuration
โ โโโ ansible/ # ๐ค Ansible playbook templates
โโโ tests/ # Integration and system tests
โโโ target/ # ๐ฆ Rust build artifacts (git-ignored)
โโโ Cargo.toml # Rust workspace configuration
โโโ Cargo.lock # Rust dependency lock file
โโโ cspell.json # Spell checking configuration
โโโ project-words.txt # Custom dictionary for spell checking
โโโ .markdownlint.json # Markdown linting configuration
โโโ .prettierignore # Prettier ignore rules (for Tera templates)
โโโ .taplo.toml # TOML formatting configuration
โโโ .yamllint-ci.yml # YAML linting configuration for CI
โโโ README.md # This file - project overview
โโโ LICENSE # Project license
โโโ .gitignore # Git ignore rules
- ๐ค User Guide - Getting started, command reference, and usage examples
- โ๏ธ Provider Guides - LXD and Hetzner Cloud provider configuration
- ๐ค Contributing Guide - Git workflow, commit process, and linting conventions
- ๐บ๏ธ Roadmap - Development roadmap and MVP goals
- ๐ Documentation Organization Guide - How documentation is organized and where to contribute
- ๐ OpenTofu Setup Guide - Installation, common commands, and best practices
- ๐ Ansible Setup Guide - Installation, configuration, and project usage
- ๐ VM Providers Comparison - Detailed comparison and decision rationale
This project now supports multiple infrastructure providers. The path to production-ready deployment is outlined in our ๐ Roadmap.
Recent achievements:
- โ Multi-Provider Support: LXD for local development, Hetzner Cloud for production deployments
- โ
Provider Selection: Choose your provider via
provider_configin environment configuration - โ
Complete CLI Commands:
create,provision,configure,test, anddestroycommands
Key upcoming milestones:
- Application Stack Management: Complete Docker Compose stacks with Torrust Tracker, MySQL, Prometheus, and Grafana
- HTTPS Support: SSL/TLS configuration for all services
- Backup & Recovery: Database backups and disaster recovery procedures
- Additional Cloud Providers: AWS, GCP, and Azure support