Infrastructure
Infrastructure | AWS — Provision Gitea
Lightweight self-hosted Git forge for lab SCM demos
AWS Gitea
Stand up a lightweight self-hosted Git forge on AWS for demos that need SCM without GitHub.com — including the AO CI/CD Pipeline demo (inventory-service + Gitea Actions).
Prerequisites
- Shared AWS networking in the target region (defaults:
aws-test-subnet,aws-test-sg,aws-test-key). Prefer:- Infrastructure ǀ AWS - Deploy Shared Services (one-click VPC + keypair + Mattermost + Gitea), or
- Cloud ǀ AWS ǀ Create VPC + Cloud ǀ AWS ǀ Create Keypair, or
- reuse an existing Deploy Cloud Stack in AWS (full stack is fine, but not required — Gitea does not need the five demo VMs)
- AWS, APD Machine Credential, and AAP Credential configured (AAP Credential is required so Provision Gitea can upsert the Gitea credential on Controller)
Configure credentials
| Credential | Type | Notes |
|---|---|---|
| AWS | Amazon Web Services | EC2 create + security group |
| APD Machine Credential | Machine | SSH as ec2-user to configure Podman |
| AAP Credential | Red Hat Ansible Automation Platform | Controller API for Gitea credential write-back |
Survey prompts
| Prompt | Variable | Default |
|---|---|---|
| AWS Region | create_vm_aws_region |
us-east-2 |
| Owner | create_vm_aws_owner_tag |
your_name (must match the owner tag on VPC/keypair resources) |
| Environment | create_vm_vm_environment |
Prod |
Job templates
| Template | Playbook | Description |
|---|---|---|
| Infrastructure ǀ AWS - Provision Gitea | infrastructure/gitea/provision_gitea.yml |
EC2 aws_gitea + Podman Gitea (SQLite) + admin + CI/CD bootstrap |
Why it matters
- One reusable Git forge for demos that need to push/pull without GitHub.com
- Same cloud networking pattern as Provision Mattermost / Provision Kafka Queue
- Seeds
apdadmin/inventory-serviceat the Lightwell vulnerable baseline (aiohttp==3.9.0, emptyPATCHED_CVE/CHANGE_REQUEST,app.py+ tests + Actions CI), enables Actions, startsact_runner, installs inventory-service dev (:8080) / prod (:80) runtimes on the same host, and upserts the Gitea credential for AO Install - Simulate Lightwell PR patches to
aiohttp==3.9.0.rhlw-00001(same 3.9.0, backport suffix only); Reset Demo restoresaiohttp==3.9.0for repeatable runs - Re-run apps only via Infrastructure ǀ AWS - Setup CI/CD Demo Host (limit
aws_gitea) without reprovisioning Gitea - Job output prints URL / username / password as the last task (
Show Gitea access information) so students can copy login from the bottom of Provision Gitea (or the nested Shared Services node)
Presenter walkthrough
- Prefer Infrastructure ǀ AWS - Deploy Shared Services for one-click networking + Gitea (and Mattermost). Or ensure networking exists via Create VPC + Create Keypair / cloud stack, then launch Infrastructure ǀ AWS - Provision Gitea alone
- At the end of the job, copy the printed URL / Username / Password block — also note
apdadmin/inventory-service - Open the URL in a browser and sign in — default login is
apdadmin/Ansible123! - Run AO Install (with the Gitea credential attached) — seed authorizes an AO webhook service account, publishes the CI/CD workflow, and writes Actions secrets
AO_WEBHOOK_URL,AO_TOKEN_URL,AO_CLIENT_ID,AO_CLIENT_SECRET - To re-show the pipeline against the same OpenFlake ticket number, launch CI/CD Demo - Reset Change Request (survey defaults to
CHG0034907) — deletes and recreates the change so Activity history is empty. Use CI/CD Demo - Reset Demo separately to restore the Gitea repo baseline.
Default admin login is apdadmin / Ansible123! (same as Mattermost; username admin is reserved by Gitea). Change it for long-lived labs.
Talking points
- Gitea runs as a Podman container with SQLite on a dedicated RHEL 9 EC2 host; Actions enabled
- Companion
gitea-runner(act_runner) mounts the host Podman socket at the same path (/run/podman/podman.sock), setsDOCKER_HOST+config.yamldocker_host, and runs privileged so job containers can start; registers with the live Admin registration token (not a homegrown secret) - Ports 3000, 80, and 8080 are opened on
aws-test-sg(Gitea UI + demo app ports used by CI/CD Setup Demo Host) - Connection details are also written to
/etc/apd-gitea.envon the host - Sync AWS Inventory afterward if you need
aws_giteaas a managed host in Controller - APD does not run upstream
cicd_setup_gitea— that would wipe this shared host; Provision Gitea owns the forge bootstrap