- www host: /_* and /api/* proxy to pocketbase :8090, everything else to the TanStack app; redir /_ /_/ for the admin path - cms host unchanged: redir / -> /_/ - migration: legacy per-host marker blocks are removed before the new combined block is installed - cms.ts: PB file urls are now same-origin relative (/api/files/...) — browsers could never load the old 127.0.0.1:8090 urls; validated the rendered Caddyfile with caddy:2
23 lines
748 B
YAML
23 lines
748 B
YAML
---
|
|
- name: Read snippet from template
|
|
ansible.builtin.set_fact:
|
|
caddy_snippet_block: "{{ lookup('ansible.builtin.template', 'snippet.j2') }}"
|
|
|
|
# migrate away from the older per-host marker blocks (pre dual-role snippet)
|
|
- name: Remove legacy per-host snippet blocks
|
|
ansible.builtin.blockinfile:
|
|
path: "{{ caddyfile_path }}"
|
|
marker: "# {mark} Ansible managed Caddy snippet for {{ item }}"
|
|
state: absent
|
|
loop:
|
|
- "{{ www_host }}"
|
|
- "{{ cms_host }}"
|
|
|
|
- name: Install mozimo Caddy snippet (web + cms)
|
|
ansible.builtin.blockinfile:
|
|
path: "{{ caddyfile_path }}"
|
|
marker: "# {mark} Ansible managed Caddy snippet (mozimo web + cms)"
|
|
block: "{{ caddy_snippet_block }}"
|
|
insertafter: EOF
|
|
notify: "Reload Caddy"
|