Parent Epic: #34 - Implement Create Environment Command
Depends On: #40 - Template System Integration
Status: OPTIONAL ENHANCEMENT
Estimated Time: 1-2 hours
⚠️ Note: This is an optional enhancement that can be deferred. It requires #40 (Template System Integration) to be completed first.
Overview
Implement the template subcommand for the create command, allowing users to generate configuration file templates. This enhances user experience by providing a starting point for configuration creation.
Goals
Architecture Requirements
DDD Layer: Presentation (CLI interface) + Infrastructure (template generation)
Module Path: src/presentation/console/subcommands/create/ + src/infrastructure/templates/
Pattern: CLI Subcommand + Template Generation
Dependencies: Requires #40 (Template System Integration) to be completed first.
CLI Interface
# Generate template configuration file (JSON format)
torrust-tracker-deployer create template
# Creates: ./environment-template.json in current working directory
# Generate template in specific directory
torrust-tracker-deployer create template ./config/environment.json
# Generate template with custom filename
torrust-tracker-deployer create template ./my-environment.json
# Show help for template subcommand
torrust-tracker-deployer create template --help
Template Example
{
"environment": {
"name": "my-environment"
},
"ssh_credentials": {
"private_key_path": "~/.ssh/id_rsa",
"public_key_path": "~/.ssh/id_rsa.pub",
"username": "torrust",
"port": 22
}
}
Acceptance Criteria
Implementation Notes
- Extend existing CLI subcommand structure from Subissue 3
- Use TemplateManager from Subissue 6 for template generation
- Follow existing patterns for CLI subcommands
- Ensure template content matches environment configuration schema
For detailed specification, see: docs/issues/epic-create-environment-command-subissue-7-template-generation-support.md
Parent Epic: #34 - Implement Create Environment Command
Depends On: #40 - Template System Integration
Status: OPTIONAL ENHANCEMENT
Estimated Time: 1-2 hours
Overview
Implement the
templatesubcommand for the create command, allowing users to generate configuration file templates. This enhances user experience by providing a starting point for configuration creation.Goals
templatesubcommand in the create command structureArchitecture Requirements
DDD Layer: Presentation (CLI interface) + Infrastructure (template generation)
Module Path:
src/presentation/console/subcommands/create/+src/infrastructure/templates/Pattern: CLI Subcommand + Template Generation
Dependencies: Requires #40 (Template System Integration) to be completed first.
CLI Interface
Template Example
{ "environment": { "name": "my-environment" }, "ssh_credentials": { "private_key_path": "~/.ssh/id_rsa", "public_key_path": "~/.ssh/id_rsa.pub", "username": "torrust", "port": 22 } }Acceptance Criteria
create templatesubcommand generates valid JSON templateenvironment-template.jsonImplementation Notes
For detailed specification, see: docs/issues/epic-create-environment-command-subissue-7-template-generation-support.md