Warning
This repo is work in progress, not finished yet.
This is an Ansible playbook for setting up the BAR Replay Server (bar-rts.com).
The playbook deploys the following containerized services using Podman Quadlet:
- PostgreSQL - Database for replay metadata, maps, and user data
- Redis - Caching and session storage
- bar-db - REST API backend serving replay data
- bar-db-processor - Background service processing replays and maps
- bar-live-services - Nuxt.js frontend application
- Caddy - Reverse proxy with automatic HTTPS
- Ansible 2.15+
- Target server running Debian 12+ (Trixie recommended)
- SSH access to target server
- Configure inventory in
inventory/directory - Create and encrypt vault secrets:
cp group_vars/prod/vault.yml.example group_vars/prod/vault.yml # Edit vault.yml with your secrets ansible-vault encrypt group_vars/prod/vault.yml - Run the playbook:
ansible-playbook -l prod play.yml --ask-vault-pass
We use Incus for local testing. Make sure you have it installed and initialized following the official getting started docs.
Create a new container and initialize it via cloud-init:
touch .incus-integration-on && \
chmod 0600 test.ssh.key && \
incus launch images:debian/trixie/cloud bar-replay-test < test.incus.yml && \
incus exec bar-replay-test -- cloud-init status --waitTest that ansible can connect:
ansible dev -m shell -a 'uname -a'Add local domain to /etc/hosts:
ansible ,localhost -b -K -m lineinfile -a "path=/etc/hosts regexp='.*bar-mon.*' line='$(ansible-inventory --host test | jq -r '.ansible_host') replay.bar-mon.local'"ansible-playbook -l dev play.yml- Frontend: https://replay.bar-mon.local
- API: https://replay.bar-mon.local/api/
ssh -i test.ssh.key ansible@$(ansible-inventory --host test | jq -r '.ansible_host')Or enter container shell directly:
incus exec bar-replay-test -- /bin/bashincus stop bar-replay-test && incus delete bar-replay-test| Variable | Description |
|---|---|
vault_postgres_password |
PostgreSQL database password |
vault_bar_db_github_token |
GitHub token for balance change processing |
vault_bar_db_lobby_username |
Teiserver bot username |
vault_bar_db_lobby_password |
Teiserver bot password |
vault_bar_db_google_sheets_id |
Google Sheets ID for map lists |
vault_bar_db_google_sheets_api_key |
Google Sheets API key |
See group_vars/all.yml for all available configuration options.
- bar-db - Backend source code
- bar-live-services - Frontend source code
- ansible-monitoring - Reference architecture