- TanStack Start (React 19, Tailwind 4) frontend recreated from Stitch design - PocketBase backend with schema migration + idempotent content seed - Single Docker image running both services (non-root, healthchecked) - deploy.sh to build & push to registry.tanshu.com - Ansible playbook (roles: app, caddy) deploying to www.greatbear.in with Caddy TLS entries for the site and the PocketBase admin
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
---
|
|
# Manage Caddy entries for the site and the PocketBase admin/API host.
|
|
- name: Ensure Caddy config include directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ caddy_config_dir }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|
|
|
|
- name: Check whether the main Caddyfile exists
|
|
ansible.builtin.stat:
|
|
path: "{{ caddyfile_path }}"
|
|
register: caddyfile_stat
|
|
|
|
- name: Ensure the main Caddyfile imports conf.d entries
|
|
ansible.builtin.lineinfile:
|
|
path: "{{ caddyfile_path }}"
|
|
line: "import {{ caddy_config_dir }}/*.conf"
|
|
insertafter: EOF
|
|
state: present
|
|
when: caddyfile_stat.stat.exists
|
|
notify: Reload Caddy
|
|
|
|
- name: Install Great Bear Caddy entries
|
|
ansible.builtin.template:
|
|
src: greatbear.conf.j2
|
|
dest: "{{ caddy_config_dir }}/greatbear.conf"
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
notify: Reload Caddy
|
|
|
|
- name: Validate Caddy configuration
|
|
ansible.builtin.command:
|
|
cmd: "caddy validate --config {{ caddyfile_path }} --adapter caddyfile"
|
|
changed_when: false
|
|
when: caddyfile_stat.stat.exists
|
|
|
|
- name: Flush handlers (reload Caddy now)
|
|
ansible.builtin.meta: flush_handlers
|
|
|
|
- name: Ensure Caddy is enabled and running
|
|
ansible.builtin.systemd:
|
|
name: "{{ caddy_service }}"
|
|
state: started
|
|
enabled: true
|