- Remove redundant manual setup (setup-vps.sh) - Ansible handles all VPS setup - Remove config templates directory - Ansible creates .env.production - Delete verbose DEPLOYMENT_SETUP.md - info consolidated into deployment/README.md - Rewrite deployment/README.md with clear 3-step workflow - Simplify deployment/ansible/README.md to quick reference - Reduce total documentation from 1159 lines to 225 lines The deployment process is now easier to understand: 1. Run Ansible playbook (one-time setup) 2. Push code to Gitea (auto-builds) 3. SSH and promote to production 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Ansible Infrastructure Setup
This playbook sets up the complete Gitea + API server infrastructure on a fresh Ubuntu 24.04 VPS.
Quick Start
# 1. Copy and edit inventory
cp hosts.ini.example hosts.ini
# Edit hosts.ini with your VPS details
# 2. Set passwords
export POSTGRES_ADMIN_PASSWORD="your-strong-password"
export API_SERVER_DB_PASSWORD="your-api-db-password"
# 3. Run playbook
ansible-playbook -i hosts.ini site.yml
What This Deploys
Infrastructure
- Gitea server (Git hosting + Actions)
- PostgreSQL (separate databases for Gitea and API)
- 5 Gitea Actions runners (self-hosted)
- Nginx reverse proxy
- UFW firewall
API Server Deployment System
/opt/api-artifacts/directory structure- Blue-green deployment scripts
- Systemd service configuration
- Environment file template
Database Setup
giteadatabase (for Gitea)apiserverdatabase (for your application)pgadminuser (admin access)apiserveruser (application access)
Configuration
Edit site.yml to customize:
vars:
create_separate_apiserver_db: true # false to share gitea DB
runner_count: 5 # Number of runners
gitea_version: "1.23.3" # Gitea version
Inventory File
Create hosts.ini:
[git]
your-vps-ip ansible_user=ubuntu ansible_ssh_private_key_file=~/.ssh/key.pem ansible_python_interpreter=/usr/bin/python3
After Ansible Runs
- Access Gitea at
http://your-vps-ip - Create admin account
- Create repository
- Push code to trigger builds
See main deployment README for full workflow.