-
Notifications
You must be signed in to change notification settings - Fork 0
Convert firewall template to centralized variables pattern #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert firewall template to centralized variables pattern #110
Conversation
…update API Co-authored-by: josecelano <[email protected]>
…file Co-authored-by: josecelano <[email protected]>
Co-authored-by: josecelano <[email protected]>
Co-authored-by: josecelano <[email protected]>
Co-authored-by: josecelano <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 <[email protected]>
Fixed in commit 73845dc. The doctest example in All doc tests now pass: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 73845dc
✅ 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.