I currently think this involves using more templating (and/or perhaps blockinfile) to manage the Caddyfile, but it could theoretically use a different file format, or even dynamically configure the running server using its RESTful JSON API.
At any rate, we really should stop editing the Caddyfile by hand, but I've intentionally been waiting until the final Caddy2 release to attempt automation, so that I am confident that the format won't change.
I currently think this involves using more templating (and/or perhaps blockinfile) to manage the Caddyfile, but it could theoretically use a different file format, or even dynamically configure the running server using its RESTful JSON API.
At any rate, we really should stop editing the Caddyfile by hand, but I've intentionally been waiting until the final Caddy2 release to attempt automation, so that I am confident that the format won't change.