Skip to content

Create Variables Template Infrastructure #105

@josecelano

Description

@josecelano

Parent Epic: #19 - Refactor Ansible Templates to Variables Pattern

Overview

Create the centralized variables.yml.tera template and supporting Rust infrastructure (context, wrapper, renderer) to consolidate Ansible playbook variables into a single file. This establishes the foundation for the variables pattern that will simplify future playbook additions.

Goals

  • Variables Template: Create templates/ansible/variables.yml.tera with system configuration variables
  • Context Layer: Implement AnsibleVariablesContext with validation
  • Wrapper Layer: Implement AnsibleVariablesTemplate for rendering
  • Renderer Layer: Implement VariablesTemplateRenderer for orchestration
  • Integration: Hook into AnsibleTemplateRenderer::render() workflow
  • Test Coverage: Comprehensive unit tests for all components

🏗️ Architecture Requirements

DDD Layer: Infrastructure
Module Path: src/infrastructure/external_tools/ansible/template/
Pattern: Template Wrapper + Context + Renderer (existing pattern)

Time Estimate

2.5 days - Complete vertical slice including implementation, testing, and documentation

Documentation

Full implementation details: docs/issues/19.1-create-variables-template.md

Acceptance Criteria

Template File

  • templates/ansible/variables.yml.tera exists with SSH port variable
  • Template has correct Tera syntax: {{ ssh_port }}
  • YAML linting passes

Implementation

  • AnsibleVariablesContext with SSH port validation
  • AnsibleVariablesTemplate wrapper implementation
  • VariablesTemplateRenderer orchestrator
  • Integration into AnsibleTemplateRenderer

Testing

  • Unit tests pass: cargo test
  • Config tests pass: cargo run --bin e2e-config-tests
  • Linters pass: cargo run --bin linter all
  • variables.yml generated in build directory

Documentation

  • Rustdoc comments for all public types
  • Template file includes descriptive comments
  • Error types have clear descriptions

Related

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