From cc85a959d1673da4aec1bae8e6ca4b701507bdd1 Mon Sep 17 00:00:00 2001 From: Phil Date: Fri, 27 Nov 2026 12:22:15 -0700 Subject: [PATCH] render: turn on every caddy_* flag so CI validates all plugin directives Co-Authored-By: Claude Opus 5.5 --- test/render_caddyfile.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/render_caddyfile.py b/test/render_caddyfile.py index 57b1660..610bfc3 100644 --- a/test/render_caddyfile.py +++ b/test/render_caddyfile.py @@ -1,6 +1,8 @@ """Render phil/ansible's Caddyfile.j2 for `caddy validate`. -Usage: render_caddyfile.py (prints the Caddyfile) +Usage: render_caddyfile.py [stock] (prints the Caddyfile) +By default every caddy_* feature flag is turned on, so CI validates all +plugin directives; "stock" renders with the flags as committed. Only non-secret group_vars are loaded. Values that reference other variables are resolved by rendering until nothing changes; values that need the vault stay unresolved, and StrictUndefined makes the Caddyfile fail loudly if it @@ -13,7 +15,10 @@ root = pathlib.Path(sys.argv[1]) ctx = {} for f in ("domains.yml", "infrastructure.yml"): ctx.update(yaml.safe_load((root / "group_vars/all" / f).read_text()) or {}) -ctx["caddy_custom"] = True +if sys.argv[2:] != ["stock"]: + for k, v in list(ctx.items()): + if k.startswith("caddy_") and isinstance(v, bool): + ctx[k] = True env = jinja2.Environment(undefined=jinja2.StrictUndefined, keep_trailing_newline=True)