ansible/roles/app_setup/README.md
ilia 69a39e5e5b Add POTE app project support and improve IP conflict detection (#3)
## Summary

This PR adds comprehensive support for deploying the **POTE** application project via Ansible, along with improvements to IP conflict detection and a new app stack provisioning system for Proxmox-managed LXC containers.

## Key Features

### 🆕 New Roles
- **`roles/pote`**: Python/venv deployment role for POTE (PostgreSQL, cron jobs, Alembic migrations)
- **`roles/app_setup`**: Generic app deployment role (Node.js/systemd)
- **`roles/base_os`**: Base OS hardening role

### 🛡️ Safety Improvements
- IP uniqueness validation within projects
- Proxmox-side IP conflict detection
- Enhanced error messages for IP conflicts

### 📦 New Playbooks
- `playbooks/app/site.yml`: End-to-end app stack deployment
- `playbooks/app/provision_vms.yml`: Proxmox guest provisioning
- `playbooks/app/configure_app.yml`: OS + application configuration

## Security
-  All secrets stored in encrypted vault.yml
-  Deploy keys excluded via .gitignore
-  No plaintext secrets committed

## Testing
-  POTE successfully deployed to dev/qa/prod environments
-  All components validated (Git, PostgreSQL, cron, migrations)

Co-authored-by: ilia <ilia@levkin.ca>
Reviewed-on: #3
2026-01-01 11:19:54 -05:00

840 B

app_setup

Creates the standard app filesystem layout and runtime services:

  • /srv/app/backend and /srv/app/frontend
  • /srv/app/.env.<dev|qa|prod>
  • /usr/local/bin/deploy_app.sh (git pull, install deps, build, migrate, restart services)
  • systemd units:
    • app-backend.service
    • app-frontend.service

All behavior is driven by variables so you can reuse this role for multiple projects.

Variables

See defaults/main.yml. Common inputs in the app stack:

  • app_project, app_env (used for naming and .env.<env> selection)
  • app_repo_url, app_repo_dest, app_repo_branch
  • app_env_vars (map written into /srv/app/.env.<env>)
  • components.backend, components.frontend (enable/disable backend/frontend setup)
  • app_backend_dir, app_frontend_dir, ports and Node.js commands