Convert firewall template to centralized variables pattern#110
Merged
josecelano merged 7 commits intomainfrom Nov 3, 2025
Merged
Conversation
…update API Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
…file Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Convert Firewall Template to Variables Pattern (Complete Vertical Slice)
Convert firewall template to centralized variables pattern
Nov 3, 2025
josecelano
requested changes
Nov 3, 2025
Member
josecelano
left a comment
There was a problem hiding this comment.
@copilot, the "testing" workflow is failing:
test src/testing/mock_clock.rs - testing::mock_clock::MockClock::set_time (line 122) ... ok
failures:
---- src/adapters/ansible/mod.rs - adapters::ansible::AnsibleClient::run_playbook (line 69) stdout ----
Test executable failed (exit status: 101).
stderr:
thread 'main' (2653) panicked at src/adapters/ansible/mod.rs:8:44:
called `Result::unwrap()` on an `Err` value: StartupFailed { command: "ansible-playbook -v install-docker.yml", source: Os { code: 2, kind: NotFound, message: "No such file or directory" } }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
src/adapters/ansible/mod.rs - adapters::ansible::AnsibleClient::run_playbook (line 69)
test result: FAILED. 232 passed; 1 failed; 5 ignored; 0 measured; 0 filtered out; finished in 51.23s
error: doctest failed, to rerun pass `-p torrust-tracker-deployer --doc`
Error: Process completed with exit code 101.
Some doc test are failing, tun doc tests with and fix them
cargo test --doc --workspace
…ency Co-authored-by: josecelano <58816+josecelano@users.noreply.github.com>
Contributor
Author
Fixed in commit 73845dc. The doctest example in All doc tests now pass: |
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.
✅ Complete Vertical Slice: Convert Firewall Template to Variables Pattern
This PR successfully implements a complete vertical slice to convert the
configure-firewall.yml.teratemplate to use the centralized variables pattern, following issue #106 specification.🎯 All Phases Complete
📋 Changes Summary
Template Conversion
configure-firewall.yml(no.teraextension)vars_files: [variables.yml]directive to playbook{{ssh_port}}→{{ ssh_port }}(proper spacing)configure-firewall.yml.teraAPI Updates
AnsibleClient::run_playbook()signature to acceptextra_args: &[&str]no_runattribute (prevents ansible-playbook requirement in CI)Static Registration
configure-firewall.ymlto static playbooks list incopy_static_templates()Rendering Cleanup
firewall_playbook_rendererfield fromAnsibleTemplateRendererrender()methodcreate_firewall_context()helper methodFirewallPlaybookRenderingFailederror variantFirewallPlaybookTemplateRendererfrom public exportsCode Cleanup (~675 lines removed)
src/infrastructure/external_tools/ansible/template/renderer/firewall_playbook.rs(347 lines)src/infrastructure/external_tools/ansible/template/wrappers/firewall_playbook/directory (328 lines)wrappers/mod.rsrenderer/mod.rsDocumentation Updates
docs/technical/template-system-architecture.mddocs/contributing/templates.mdtemplates/ansible/README.md✅ Validation Complete
Tests:
cargo test(1065 tests, 0 failures)cargo test --doc(233 tests, 0 failures)cargo build --releaseLinters:
cargo run --bin linter allcargo macheteTemplate Verification:
configure-firewall.ymlcopied to build directoryvars_files: [variables.yml]variables.ymlgenerated with correct SSH port📊 Impact
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.