{"id":51014234,"url":"https://github.com/jrtashjian/homelab-infra-gitlab","last_synced_at":"2026-06-21T08:01:53.420Z","repository":{"id":353201816,"uuid":"1218407740","full_name":"jrtashjian/homelab-infra-gitlab","owner":"jrtashjian","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-02T06:04:18.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-02T08:16:22.491Z","etag":null,"topics":["ansible","gitlab","gitlab-runners","homelab","terraform"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jrtashjian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-22T21:05:55.000Z","updated_at":"2026-05-02T06:04:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jrtashjian/homelab-infra-gitlab","commit_stats":null,"previous_names":["jrtashjian/homelab-infra-gitlab"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jrtashjian/homelab-infra-gitlab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrtashjian%2Fhomelab-infra-gitlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrtashjian%2Fhomelab-infra-gitlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrtashjian%2Fhomelab-infra-gitlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrtashjian%2Fhomelab-infra-gitlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jrtashjian","download_url":"https://codeload.github.com/jrtashjian/homelab-infra-gitlab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrtashjian%2Fhomelab-infra-gitlab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34601662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","gitlab","gitlab-runners","homelab","terraform"],"created_at":"2026-06-21T08:01:52.801Z","updated_at":"2026-06-21T08:01:53.412Z","avatar_url":"https://github.com/jrtashjian.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitLab Infrastructure\n\nThis repository manages the provisioning and configuration of a self-hosted GitLab instance and its CI/CD runners using **Terraform** for VM provisioning and **Ansible** for host-level configuration.\n\n**Terraform** provisions the GitLab VM and runner VMs on Proxmox using a shared VM module. It creates a GitLab server, standard-sized runners, and large runners spread across cluster nodes.\n\n**Ansible** configures the runner VMs with Docker and the GitLab Runner service, deploys a shared S3-compatible (MinIO) cache configuration, and manages runner registration and deregistration against the GitLab instance.\n\n## Terraform\n\n### Local Development\n\nTo run Terraform commands locally, use the provided `.env.example` as a template:\n\n```bash\ncp .env.example .env\n```\n\nFill in the values in `.env` using [1Password Secret References](https://developer.1password.com/docs/cli/secret-references/) (e.g. `op://vault/item/field`) or plain values. Then use the [1Password CLI](https://developer.1password.com/docs/cli) to inject secrets at runtime:\n\n```bash\n# Preview changes\nop run --env-file=\".env\" -- terraform plan\n\n# Apply changes\nop run --env-file=\".env\" -- terraform apply\n```\n\n### Variables for CI/CD Pipeline\n\nThe pipeline utilizes [1Password Service Account](https://developer.1password.com/docs/service-accounts) for retrieving passwords [defined as variables](https://docs.gitlab.com/ee/ci/variables/#define-a-cicd-variable-in-the-ui) using the [Secret Reference](https://developer.1password.com/docs/cli/secret-references/) syntax.\n\n#### GitLab CI/CD Workflow Variables\n\nRequired by the GitLab CI/CD workflow itself. Set these as CI/CD variables in the GitLab project settings.\n\n| Variable | Description |\n|---|---|\n| `OP_SERVICE_ACCOUNT_TOKEN` | The service account token used by the GitLab CI/CD workflow to authenticate with 1Password. |\n\n#### Environment Variables\n\nCredentials passed to Terraform at runtime via 1Password secret references. Set these as CI/CD variables in the GitLab project settings.\n\n| Variable | Description |\n|---|---|\n| `PROXMOX_VE_ENDPOINT` | The URL of the Proxmox Virtual Environment API endpoint. |\n| `PROXMOX_VE_USERNAME` | The username and realm for the Proxmox Virtual Environment API. |\n| `PROXMOX_VE_PASSWORD` | The password for the Proxmox Virtual Environment API. |\n| `TF_VAR_ansible_user` | The user Ansible connects as on provisioned VMs. |\n| `TF_VAR_ansible_pass` | The password for the Ansible user. |\n| `TF_VAR_ansible_public_key` | The SSH public key added to provisioned VMs. |\n\n## Ansible\n\nAnsible configures the GitLab runner VMs. Playbooks and roles are in the `ansible/` directory.\n\n### Setup\n\nInstall the required Ansible collections:\n\n```bash\ncd ansible\nansible-galaxy install --force -r requirements.yml\n```\n\nRun the vault setup script to fetch the Ansible vault password and encrypt vault files using [1Password CLI](https://developer.1password.com/docs/cli):\n\n```bash\n./setup-vaults.sh\n```\n\n### Playbooks\n\n**Deploy** — installs Docker and GitLab Runner, and deploys the runner config template:\n\n```bash\nansible-playbook playbooks/deploy.yml\n```\n\n**Register runners** — creates a runner via the GitLab API and registers it on each host (skips hosts already registered):\n\n```bash\nansible-playbook playbooks/register-runners.yml\n```\n\n**Unregister runners** — deregisters and removes the runner config from each host:\n\n```bash\nansible-playbook playbooks/unregister-runners.yml\n```\n\n**Docker prune** — runs `docker system prune --all --force` on all runner hosts:\n\n```bash\nansible-playbook playbooks/docker-prune.yml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrtashjian%2Fhomelab-infra-gitlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjrtashjian%2Fhomelab-infra-gitlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrtashjian%2Fhomelab-infra-gitlab/lists"}