feat: [#208] Add provider configuration to EnvironmentCreationConfig#211
Merged
josecelano merged 1 commit intomainfrom Dec 2, 2025
Merged
feat: [#208] Add provider configuration to EnvironmentCreationConfig#211josecelano merged 1 commit intomainfrom
josecelano merged 1 commit intomainfrom
Conversation
This commit implements issue #208 from the Hetzner Provider Support epic (#205). Changes: - Add 'provider' field to EnvironmentCreationConfig (ProviderSection for JSON parsing) - Add 'instance_name' optional field to EnvironmentSection (auto-generated if not provided) - Update to_environment_params() to return (EnvironmentName, InstanceName, ProviderConfig, SshCredentials, port) - Add InvalidInstanceName error variant with actionable help message - Add clap::ValueEnum derive to Provider enum for CLI argument parsing - Add --provider/-p required argument to 'create template' command - Generate provider-specific templates (LXD with profile_name, Hetzner with api_token) - Update JSON configuration format to include provider section - Update documentation and help messages to reflect new configuration format - Update all tests to include provider configuration Breaking Change: - Environment JSON files now require a 'provider' section - 'create template' command now requires --provider argument Example LXD configuration: { "environment": { "name": "dev" }, "ssh_credentials": { ... }, "provider": { "provider": "lxd", "profile_name": "torrust-profile-dev" } } Example Hetzner configuration: { "environment": { "name": "prod" }, "ssh_credentials": { ... }, "provider": { "provider": "hetzner", "api_token": "your-token", "server_type": "cx22", "location": "nbg1" } }
Member
Author
|
ACK 792e69d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements issue #208 from the Hetzner Provider Support epic (#205).
Changes
Core Configuration Updates
providerfield toEnvironmentCreationConfig(usesProviderSectionfor JSON parsing)instance_nameoptional field toEnvironmentSection(auto-generated astorrust-tracker-vm-{env_name}if not provided)to_environment_params()to return(EnvironmentName, InstanceName, ProviderConfig, SshCredentials, port)Error Handling
InvalidInstanceNameerror variant with actionable help messageCLI Updates
clap::ValueEnumderive toProviderenum for CLI argument parsing--provider/-prequired argument tocreate templatecommandprofile_nameplaceholderapi_token,server_type,locationplaceholdersDocumentation
docs/user-guide/commands/create.mdwith new configuration formatTests
Breaking Changes
providersectioncreate templatecommand now requires--providerargumentExample Configurations
LXD Provider
{ "environment": { "name": "dev", "instance_name": "torrust-tracker-vm-dev" }, "ssh_credentials": { "private_key_path": "fixtures/testing_rsa", "public_key_path": "fixtures/testing_rsa.pub", "username": "torrust", "port": 22 }, "provider": { "provider": "lxd", "profile_name": "torrust-profile-dev" } }Hetzner Provider
{ "environment": { "name": "prod", "instance_name": "torrust-tracker-demo" }, "ssh_credentials": { "private_key_path": "~/.ssh/id_rsa", "public_key_path": "~/.ssh/id_rsa.pub", "username": "torrust", "port": 22 }, "provider": { "provider": "hetzner", "api_token": "your-hetzner-api-token", "server_type": "cx22", "location": "nbg1" } }Testing
Related Issues