Add support for ssh configs as templates, via JinjaTurtle

This commit is contained in:
Miguel Jacq 2026-05-12 12:23:41 +10:00
parent 5c686d27cc
commit 5695f4258e
Signed by: mig5
GPG key ID: 03906B4110AAD3B8
3 changed files with 24 additions and 0 deletions

View file

@ -131,3 +131,15 @@ def test_manifest_uses_jinjaturtle_templates_and_does_not_copy_raw(
encoding="utf-8"
)
assert "foo_key: 1" in defaults
def test_openssh_paths_are_jinjaturtle_supported_and_forced_to_ssh() -> None:
from enroll.jinjaturtle import can_jinjify_path, infer_other_formats
assert infer_other_formats("/etc/ssh/sshd_config") == "ssh"
assert infer_other_formats("/etc/ssh/ssh_config") == "ssh"
assert infer_other_formats("/etc/ssh/sshd_config.d/50-hardening.conf") == "ssh"
assert infer_other_formats("/etc/ssh/ssh_config.d/99-proxy.conf") == "ssh"
assert can_jinjify_path("/etc/ssh/sshd_config")
assert can_jinjify_path("/etc/ssh/ssh_config")