feat(honcho): add role + day1 playbook + traefik route for lincoln
Deploys Honcho (plastic-labs/honcho) as a rootful Podman + Quadlet service on the lincoln VM (10.1.71.132). Three containers on a user-defined network: - honcho-postgres pgvector/pgvector:pg16 - honcho-api FastAPI on :8000 - honcho-deriver background worker for theory-of-mind derivations LLM provider: Anthropic Claude (claude-sonnet-4-5). Switching providers is two env-var changes — see README. Traefik route hall-of-presidents.local.mk-labs.cloud -> lincoln:8000 added under boilerplates/traefik/dynamic/. JARVIS itself talks to Honcho directly at lincoln:8000 (east-west); the Traefik alias exists only for browser access to the Swagger /docs UI. Requires three new vault entries before first run: - vault_honcho_database_password - vault_honcho_jwt_secret - vault_honcho_anthropic_api_key
This commit is contained in:
48
ansible/roles/honcho/tasks/postgres.yml
Normal file
48
ansible/roles/honcho/tasks/postgres.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
# ============================================================================
|
||||
# pgvector PostgreSQL container (Quadlet)
|
||||
# ----------------------------------------------------------------------------
|
||||
# Honcho stores embeddings in pgvector, so we use the pgvector-enabled
|
||||
# image rather than stock postgres. Same env-var surface as the upstream
|
||||
# image; the pgvector extension is created by Honcho's migration script
|
||||
# on first start (scripts/provision_db.py).
|
||||
# ============================================================================
|
||||
|
||||
- name: Deploy Honcho PostgreSQL Quadlet
|
||||
ansible.builtin.template:
|
||||
src: honcho-postgres.container.j2
|
||||
dest: "{{ honcho_quadlet_dir }}/{{ honcho_postgres_container_name }}.container"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
register: postgres_quadlet
|
||||
|
||||
- name: Reload systemd to pick up Quadlet changes
|
||||
ansible.builtin.systemd:
|
||||
daemon_reload: true
|
||||
when: postgres_quadlet.changed
|
||||
|
||||
- name: Ensure Honcho PostgreSQL container is started and enabled
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ honcho_postgres_container_name }}.service"
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Wait for PostgreSQL to accept connections
|
||||
ansible.builtin.command:
|
||||
cmd: >-
|
||||
podman exec {{ honcho_postgres_container_name }}
|
||||
pg_isready -U {{ honcho_db_user }} -d {{ honcho_db_name }}
|
||||
register: pg_ready
|
||||
until: pg_ready.rc == 0
|
||||
retries: 30
|
||||
delay: 2
|
||||
changed_when: false
|
||||
|
||||
# Quadlet does not auto-restart on .container changes — same pitfall as
|
||||
# semaphore role. Force restart only when the template was modified.
|
||||
- name: Restart Honcho PostgreSQL on Quadlet change
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ honcho_postgres_container_name }}.service"
|
||||
state: restarted
|
||||
when: postgres_quadlet.changed
|
||||
Reference in New Issue
Block a user