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 port3000over HTTPS) - SSH Port:
2222(Mapped to container port22for Git over SSH) - Security & TLS: TLS certificates generated via
community.cryptoand 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: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)
- Ansible Vault: Always store database and admin credentials in encrypted vault files (
ansible-vault create). - Dynamic Ingestion: Use
lookup('ansible.builtin.env', 'GITEA_DB_PASSWORD')for runtime terminal injection. - Repository Exclusions: Confirm
.gitignoreincludes*.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