Comment blocks now stay within three lines and explain only the non-obvious. Long histories, include examples, and commented-out code are gone. No task, key, or value changed; the only data change is comment text inside the generated unit files.
50 lines
1.8 KiB
YAML
50 lines
1.8 KiB
YAML
---
|
|
# Derived from the connection user; requires gather_facts.
|
|
podman_user: "{{ ansible_facts['user_id'] }}"
|
|
podman_data_dir: "{{ ansible_facts['user_dir'] }}/podman-data"
|
|
quadlet_dir: "{{ ansible_facts['user_dir'] }}/.config/containers/systemd"
|
|
|
|
host: bridge.tanshu.dev
|
|
|
|
container_name: sms-wa-bridge
|
|
unit_name: "{{ container_name }}.service"
|
|
|
|
# The Quadlet file is <network_name>.network; register pins <network_name>_net.
|
|
network_name: "{{ container_name }}"
|
|
|
|
# The image exists in no registry; load it from monoco or build it here.
|
|
# A rebuild can re-resolve whatsapp-web.js and break the paired session, so prefer podman load.
|
|
# Keep it fully qualified so rootless Podman never prompts; there is no TTY.
|
|
image: localhost/sms-wa-bridge:latest
|
|
|
|
# What podman load calls a docker-saved tag; the play re-tags it to image.
|
|
image_docker_hub: docker.io/library/sms-wa-bridge:latest
|
|
|
|
# Set true to rebuild from files/build/ after editing server.js.
|
|
rebuild_image: false
|
|
|
|
# Same four entries and layout as monoco's /var/lib/sms-wa-bridge, so the tar lands as-is.
|
|
host_directory: "{{ podman_data_dir }}/{{ container_name }}"
|
|
|
|
build_dir: "{{ podman_data_dir }}/{{ container_name }}-build"
|
|
|
|
container_port: 8080
|
|
|
|
# Kept verbatim so the cutover only changes the URL.
|
|
auth_secret: "64f205031acc01744b6edc23"
|
|
|
|
# Read by podman through EnvironmentFile=, not by Ansible, so write it before the unit starts.
|
|
env_file: "{{ host_directory }}/{{ container_name }}.env"
|
|
|
|
# The runtime image has wget, not curl.
|
|
# /health answers 200 whenever the server is up, not when WhatsApp is paired.
|
|
health_cmd: "wget -q -O /dev/null http://127.0.0.1:{{ container_port }}/health"
|
|
|
|
caddy_name: caddy
|
|
caddyfile_path: "{{ podman_data_dir }}/{{ caddy_name }}/conf/Caddyfile"
|
|
|
|
snippet_block: |
|
|
{{ host }} {
|
|
reverse_proxy {{ container_name }}:{{ container_port }}
|
|
}
|