6.9 KiB
6.9 KiB
Session Handoff: Appwrite Removal / Supabase Migration
Date: 2026-04-15 Session Focus: Remove all Appwrite-specific automation and rebase repo on Supabase as the backend Context Usage at Handoff: ~40%
What Was Accomplished
- Fixed lint errors (
risky-shell-pipe,no-changed-when) inplaybooks/backup_supabase_prod.yml(later deleted) andplaybooks/sync_gitea_secrets.yml - Fixed vault lookup syntax across 3 playbooks — changed from
secret=path url=... engine_mount_point=kvformat tokv/data/<path>format, matching the working pattern used elsewhere in the repo - Deleted all Appwrite-specific playbooks, task files, templates, and inventory (see Files section below)
- Rewrote
playbooks/backup_supabase.ymlto be env-driven: play 1 targetssupabasegroup (logical hosts), play 2 targetsbackup_dest; environment selected via--limit supabase-devor--limit supabase-prod - Rewrote
playbooks/sync_gitea_secrets.ymlto be env-driven: targetssupabasegroup, single env per run, one set of tasks usingsupabase_vault_pathandgitea_variable_namefrom host_vars - Created logical inventory hosts
supabase-devandsupabase-prodwithansible_connection: localand per-env vars - User subsequently reorganized
static.yml:supabase-devplaced underdevgroup (alongsidebab1.mgmt.toal.ca),supabase-prodplaced underprodgroup; originalsupabasegroup removed
Exact State of Work in Progress
playbooks/backup_supabase.ymlandplaybooks/sync_gitea_secrets.ymlboth havehosts: supabase— but after the user's inventory reorganization, nosupabasegroup exists. Both playbooks will fail to match any hosts until this is resolved. See Open Questions below.
Decisions Made This Session
- Vault lookup format changed to
kv/data/<path>BECAUSE this matches the working pattern used elsewhere (vault_oidc_client_secretexample), and oldsecret=path url=...format was failing — STATUS: confirmed - Supabase logical hosts (
supabase-dev,supabase-prod) useansible_connection: localBECAUSE the Supabase databases are external cloud services; pg_dump and Gitea API calls run on the control node regardless of which env is targeted — STATUS: confirmed add_hostpattern (_backup_infosynthetic host) used to pass_backup_filename,_tmpdir_path,_backup_file_prefixbetween play 1 and play 2 in backup playbook BECAUSEset_factin play 1 stores on thesupabase-*host objects, not onbackup_dest; hostvars reference would require knowing which source host ran — STATUS: confirmed, lint-cleangitea_variable_nameadded as host var (ENV_FILE_DEV/ENV_FILE_PROD) so the sync playbook has a single generic URI task — STATUS: confirmed
Key Numbers Generated or Discovered This Session
- Playbooks deleted: 8 (
backup_appwrite,bootstrap_appwrite,install_appwrite,upgrade_appwrite,provision_database,provision_users,load_data,read_database) - Task files deleted: 2 (
tasks/patch_appwrite_compose.yml,tasks/upgrade_appwrite_step.yml) - Templates deleted: 2 (
templates/appwrite.env.j2,templates/appwrite.service.j2) - Host_vars deleted: 3 files for bab1 (
appwrite.yml,dev.yml,secrets.yml), all ofcloud.appwrite.io/ - Group_vars deleted: entire
group_vars/appwrite/directory
Conditional Logic Established
- IF targeting
supabase-devTHEN vault pathkv/data/oys/dev/supabase, prefixoysqn-dev, Gitea varENV_FILE_DEV - IF targeting
supabase-prodTHEN vault pathkv/data/oys/prod/supabase, prefixoysqn-prod, Gitea varENV_FILE_PROD - IF
backup_supabase.ymlruns for multiple supabase hosts in one run THEN_backup_infoadd_host is overwritten by the last host — backup playbook is designed for single-env targeting per run
Files Created or Modified
| File Path | Action | Description |
|---|---|---|
playbooks/backup_supabase.yml |
Rewrote | play 1: hosts: supabase, connection local, add_host for cross-play facts; play 2: hosts: backup_dest, retention patterns use _prefix var |
playbooks/sync_gitea_secrets.yml |
Rewrote | hosts: supabase, single env per run, 4 tasks using supabase_vault_path and gitea_variable_name |
inventories/bab-inventory/static.yml |
Modified | Removed appwrite/prod groups and cloud.appwrite.io; added supabase group (then user reorganized: supabase-dev → dev, supabase-prod → prod) |
inventories/bab-inventory/host_vars/supabase-dev/main.yml |
Created | ansible_connection: local, supabase_vault_path, backup_file_prefix: oysqn-dev, gitea_variable_name: ENV_FILE_DEV |
inventories/bab-inventory/host_vars/supabase-prod/main.yml |
Created | ansible_connection: local, supabase_vault_path, backup_file_prefix: oysqn-prod, gitea_variable_name: ENV_FILE_PROD |
inventories/bab-inventory/host_vars/bab1.mgmt.toal.ca/oysqn.yml |
Unchanged | Still has backup_base_dir and backup_retain_* vars — used by play 2 of backup playbook |
What the NEXT Session Should Do
- First: Read this handoff
- Resolve
hosts: supabasemismatch: Bothbackup_supabase.ymlandsync_gitea_secrets.ymltargethosts: supabasebutstatic.ymlno longer has asupabasegroup. Options:- Add a
supabaseparent group back tostatic.ymlwithdevandprodas children (cleanest —--limit supabase-devstill works) - Change playbook targets to
devandprodgroups (but then bab1 would also matchdevand lacks the supabase vars) - Change playbook targets to
supabase-dev:supabase-prod
- Add a
- Verify vault secret key names: ASSUMED keys
postgres_url,url,anon_keyin supabase secrets andvaluein gitea_token — run a test and confirm
Open Questions Requiring User Input
hosts: supabasein both playbooks — nosupabasegroup exists after inventory reorganization. How should playbooks target the supabase logical hosts? Recommend addingsupabaseas a parent group containingdevandprodas children.- Vault secret key names: are
postgres_url(for pg_dump connection),url,anon_key(for env file), andvalue(for gitea token) the correct keys in the respective vault secrets?
Assumptions That Need Validation
- ASSUMED:
_supabase.postgres_urlis the key for the Supabase Postgres connection string in vault — validate by checkingvault kv get kv/oys/dev/supabase - ASSUMED:
_supabase.urland_supabase.anon_keyare the correct keys for the Gitea env file content - ASSUMED:
_gitea_token.valueis the correct key for the Gitea API token secret
What NOT to Re-Read
docs/archive/handoffs/handoff-2026-03-15-appwrite-function-dns-fix.md— archived, all Appwrite work is deleted
Files to Load Next Session
playbooks/backup_supabase.yml— if resolving the hosts target issue or testingplaybooks/sync_gitea_secrets.yml— if resolving the hosts target issue or testinginventories/bab-inventory/static.yml— to resolve group structure