Skip to main content
This guide details how to automate the standalone deployment of a self-hosted Gitea GitOps stack over rootless Podman using Ansible playbooks. The workflow handles OS dependencies, linger enablement, secret vaulting, 5-year Sovereign TLS certificate generation, Quadlet systemd unit deployment, and installation screen bypass automatically.

1. Overview & Architecture

Using Ansible for deployment guarantees idempotent, reproducible infrastructure provisioning.

Key Architecture Specs

  • Default Domain / Host IP: 10.17.250.28 (or target inventory host)
  • Database Backend: PostgreSQL 15 (Alpine)
  • Application Server: Gitea 1.26.3
  • HTTP/HTTPS Port: 3000 (Mapped to container port 3000 over HTTPS)
  • SSH Port: 2222 (Mapped to container port 22 for Git over SSH)
  • Security & TLS: TLS certificates generated via community.crypto and signed by Sovereign CA.
  • Automated Bypass: Bypasses web installation screen programmatically (GITEA__security__INSTALL_LOCK: "true").

2. Prerequisites & Ansible Setup

Ensure Ansible and required collection packages are installed on the control node:
Verify target inventory connectivity:

3. Ansible Role & Playbook Structure

The deployment relies on Ansible role variables and task definitions:

Role Defaults (roles/gitea/defaults/main.yml)

Main Task Execution Flow (roles/gitea/tasks/main.yml)

Sovereign TLS Task Automation (roles/gitea/tasks/tls.yml)


4. Playbook Execution Commands

Deploy Locally on Active Host

Deploy Remote Host Inventory

Deploy Using Ansible Vault for Encrypted Passwords


5. Post-Deployment Verification

Verify that Gitea systemd service and containers are active on target host:

6. Securing Secrets in Ansible & Git (Best Practices)

  1. Ansible Vault: Always store database and admin credentials in encrypted vault files (ansible-vault create).
  2. Dynamic Ingestion: Use lookup('ansible.builtin.env', 'GITEA_DB_PASSWORD') for runtime terminal injection.
  3. Repository Exclusions: Confirm .gitignore includes *.env, *credentials.txt, and private key files (*.key).

Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-08-20 Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0