--- # --------------------------------------------------------------------------- # Rootless Podman / Quadlet # --------------------------------------------------------------------------- # Duplicated on purpose from caddy/vars/default.yml: a play cannot include that # file wholesale, because it also sets `host_directory` — to the Caddy data # directory — and every playbook defines that for itself. Keep these three in # sync with caddy/vars/default.yml. (Its fourth, podman_unprivileged_port_start, # belongs to the podman tasks, which this play does not run: Tandoor listens on # 80 inside the container and publishes nothing host-side.) # # podman_user is derived from the connection: this play carries no become, so # the Quadlet units belong to whoever Ansible connects as. Requires gather_facts # (set in playbook.yml). podman_user: "{{ ansible_facts['user_id'] }}" podman_data_dir: "{{ ansible_facts['user_dir'] }}/podman-data" quadlet_dir: "{{ ansible_facts['user_dir'] }}/.config/containers/systemd" # --------------------------------------------------------------------------- # Tandoor # --------------------------------------------------------------------------- host: recipes.tanshu.com container_name: tandoor unit_name: "{{ container_name }}.service" # Fully qualified on purpose: rootless Podman resolves short names against # unqualified-search-registries, and there is no TTY to answer a prompt when # the systemd unit starts. image: docker.io/vabene1111/recipes:latest # The Quadlet file is .network. caddy/roles/register pins the # Podman network name to _net (so: tandoor.network, tandoor_net). network_name: "{{ container_name }}" host_directory: "{{ podman_data_dir }}/{{ container_name }}" # Port Caddy proxies to, inside the container (the image's own nginx). container_port: 80 # The shared Postgres unit this app attaches itself to (postgres/playbook.yml). # roles/postgres owns this app's drop-ins there and the "Restart Postgres" # handler that applies them. postgres_container: postgres postgres_unit: "{{ postgres_container }}.service" # The shared Caddy unit and its Caddyfile, both owned by caddy/playbook.yml. caddy_name: caddy caddyfile_path: "{{ podman_data_dir }}/{{ caddy_name }}/conf/Caddyfile" snippet_block: | {{ host }} { reverse_proxy {{ container_name }}:{{ container_port }} }