{"id":24432645,"url":"https://github.com/davidfischer-ch/terraform-module-dockerized-gitlab-runner","last_synced_at":"2026-04-21T16:02:57.075Z","repository":{"id":69239303,"uuid":"575441269","full_name":"davidfischer-ch/terraform-module-dockerized-gitlab-runner","owner":"davidfischer-ch","description":"Dockerized GitLab Runner managed with Terraform","archived":false,"fork":false,"pushed_at":"2024-06-22T19:16:36.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T16:02:21.959Z","etag":null,"topics":["docker","gitlab","gitlab-ci"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidfischer-ch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-12-07T14:19:44.000Z","updated_at":"2024-04-22T11:50:03.000Z","dependencies_parsed_at":"2024-06-23T02:11:48.840Z","dependency_job_id":"61cb8f73-d17c-4b20-a33d-03aeea085457","html_url":"https://github.com/davidfischer-ch/terraform-module-dockerized-gitlab-runner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfischer-ch%2Fterraform-module-dockerized-gitlab-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfischer-ch%2Fterraform-module-dockerized-gitlab-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfischer-ch%2Fterraform-module-dockerized-gitlab-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfischer-ch%2Fterraform-module-dockerized-gitlab-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidfischer-ch","download_url":"https://codeload.github.com/davidfischer-ch/terraform-module-dockerized-gitlab-runner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243475330,"owners_count":20296714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["docker","gitlab","gitlab-ci"],"created_at":"2025-01-20T16:01:34.944Z","updated_at":"2026-04-21T16:02:57.067Z","avatar_url":"https://github.com/davidfischer-ch.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitLab Runner Terraform Module (Dockerized)\n\nManage a GitLab Runner using the [Docker Executor](https://docs.gitlab.com/runner/executors/docker.html).\n\n\u003e **Limitation:** Multi-runner examples is not yet supported or documented.\n\n* Registers the runner once at creation time (taint `gitlab_runner.runner` to force re-registration)\n* Unregisters the runner at destruction time (clean GitLab state)\n* Stores the authentication token as an environment variable — not hardcoded in `config.toml`\n* Any configuration change is reflected to the appropriate resources automatically\n\n## Usage\n\nSee [examples/default](examples/default) for a complete working configuration.\n\n```hcl\nprovider \"gitlab\" {\n  base_url = \"https://gitlab.example.com\"\n}\n\ndata \"gitlab_group\" \"example\" {\n  full_path = \"example\"\n}\n\nresource \"docker_image\" \"runner\" {\n  name = \"gitlab/gitlab-runner:latest\"\n}\n\nmodule \"runner\" {\n  source = \"git::https://github.com/davidfischer-ch/terraform-module-dockerized-gitlab-runner.git?ref=2.1.1\"\n\n  identifier  = \"my-runner\"\n  description = \"Dockerized runner hosted on my computer for testing purposes\"\n  image_id    = docker_image.runner.image_id\n\n  # Storage\n\n  data_directory = \"/data\"\n\n  # Registration\n\n  server_url  = \"https://gitlab.example.com\"\n  runner_type = \"group\"\n  group_id    = data.gitlab_group.example.id\n\n  # Global Settings\n\n  concurrency = 4\n  log_level   = \"warn\"\n\n  # Jobs Core Settings\n\n  jobs_protected = false\n  jobs_tags      = [\"for:test\", \"node:my-computer\"]\n\n  # Jobs Docker Executor Settings\n\n  jobs_privileged = false\n}\n```\n\n## Data layout\n\nAll persistent data lives under `data_directory`:\n\n```\ndata_directory/\n└── {identifier}/\n    ├── builds/\n    ├── cache/\n    ├── config/\n    │   ├── certs/\n    │   └── config.toml\n    └── scripts/\n        ├── check-live\n        └── entrypoint\n```\n\n## Variables\n\n| Name | Type | Default | Description |\n|------|------|---------|-------------|\n| `identifier` | `string` | — | Unique name for resources and runner (must match `^[a-z]+(-[a-z0-9]+)*$`). |\n| `description` | `string` | — | Maintenance note. |\n| `labels` | `map(string)` | — | Labels attached to the runner container. |\n| `enabled` | `bool` | `true` | Start or stop the runner container. |\n| `paused` | `bool` | `false` | Pause the runner (do not process jobs). |\n| `env` | `map(string)` | `{}` | Environment variables for the runner (not the jobs). |\n| `image_id` | `string` | — | [GitLab Runner](https://hub.docker.com/r/gitlab/gitlab-runner/tags) Docker image's ID. |\n| `cpu_set` | `string` | `null` | CPUs the runner can use (e.g. `0-4`, `1,3`). |\n| `cpu_shares` | `number` | `null` | CPU share ratio (e.g. `0.5`). |\n| `memory` | `number` | `512` | Memory limit in MB (minimum 64). |\n| `swap` | `number` | `128` | Swap limit in MB. |\n| `hosts` | `map(string)` | `{}` | Extra `/etc/hosts` entries for the container. |\n| `metrics_port` | `number` | `9252` | Host port for Prometheus metrics. |\n| `data_directory` | `string` | — | Host path for persistent volumes. |\n| `runner_type` | `string` | — | Runner scope: `instance`, `group`, or `project`. |\n| `group_id` | `string` | `null` | Group ID (group runners only). |\n| `project_id` | `string` | `null` | Project ID (project runners only). |\n| `server_url` | `string` | — | GitLab server URL. |\n| `server_ca_cert` | `string` | `null` | Custom CA certificate content (PEM). |\n| `check_interval` | `number` | `3` | Interval between job checks in seconds. |\n| `concurrency` | `number` | `10` | Max concurrent jobs across all runners on this host. |\n| `log_format` | `string` | `\"text\"` | Log format (`runner`, `text`, `json`). |\n| `log_level` | `string` | `\"warn\"` | Log level (`debug`, `info`, `warn`, `error`, `fatal`, `panic`). |\n| `debug_enabled` | `bool` | `false` | Enable debugging mode. |\n| `metrics_enabled` | `bool` | `false` | Enable Prometheus metrics exporter. |\n| `jobs_concurrency` | `number` | `0` | Max concurrent jobs for this runner (0 = unlimited). |\n| `jobs_env` | `map(string)` | `{}` | Environment variables injected into jobs. |\n| `jobs_extra_hosts` | `map(string)` | `{}` | Extra hosts defined in the job container environment. |\n| `jobs_locked` | `bool` | `true` | Lock runner to a specific group or project. |\n| `jobs_output_limit` | `number` | `4096` | Max build log size in KB. |\n| `jobs_protected` | `bool` | `true` | Only protected branches can trigger jobs. |\n| `jobs_requests_concurrency` | `number` | `1` | Max concurrent job requests to GitLab. |\n| `jobs_run_untagged` | `bool` | `false` | Run untagged jobs. |\n| `jobs_tags` | `list(string)` | — | Runner tags for job dispatch. |\n| `jobs_timeout` | `number` | `3600` | Job timeout in seconds. |\n| `jobs_allowed_images` | `list(string)` | `[\"*/*:*\"]` | Allowed image patterns. |\n| `jobs_allowed_pull_policies` | `list(string)` | `[\"always\", \"if-not-present\", \"never\"]` | Allowed pull policies. |\n| `jobs_allowed_services` | `list(string)` | `[\"*/*:*\"]` | Allowed service image patterns. |\n| `jobs_pull_policy` | `list(string)` | `[\"always\", \"if-not-present\"]` | Pull policies tried in order. |\n| `jobs_privileged` | `bool` | `false` | Run job containers in privileged mode. |\n| `jobs_volumes` | `list(string)` | `[]` | Additional volume mounts for jobs. |\n\n## Requirements\n\n* Terraform \u003e= 1.6\n* [kreuzwerker/docker](https://github.com/kreuzwerker/terraform-provider-docker) \u003e= 3.0.2\n* [gitlabhq/gitlab](https://github.com/gitlabhq/terraform-provider-gitlab) \u003e= 16.8.1\n* [hashicorp/local](https://github.com/hashicorp/terraform-provider-local) \u003e= 2.4.1\n\n## References\n\n* https://hub.docker.com/r/gitlab/gitlab-runner/tags\n* https://docs.gitlab.com/runner/executors/docker.html\n* https://docs.gitlab.com/runner/configuration/advanced-configuration.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfischer-ch%2Fterraform-module-dockerized-gitlab-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidfischer-ch%2Fterraform-module-dockerized-gitlab-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfischer-ch%2Fterraform-module-dockerized-gitlab-runner/lists"}