- snippet generation moved to a j2 template; per-host pb_root flag - cms.mozimo.in emits 'redir / /_/' before reverse_proxy (pattern from overlord's Caddyfile); other hosts unchanged - snippets now update in place (blockinfile idempotency) instead of skipping when the desired block changed
13 lines
438 B
YAML
13 lines
438 B
YAML
---
|
|
- name: Build Caddy snippet block for {{ snippet.host }}
|
|
ansible.builtin.set_fact:
|
|
snippet_block: "{{ lookup('ansible.builtin.template', 'snippet.j2') }}"
|
|
|
|
- name: Install snippet block for {{ snippet.host }}
|
|
ansible.builtin.blockinfile:
|
|
path: "{{ caddyfile_path }}"
|
|
marker: "# {mark} Ansible managed Caddy snippet for {{ snippet.host }}"
|
|
block: "{{ snippet_block }}"
|
|
insertafter: EOF
|
|
notify: "Reload Caddy"
|