{"id":18987665,"url":"https://github.com/samsulmaarif/ansible-gitlab-runner","last_synced_at":"2026-05-15T18:34:11.452Z","repository":{"id":142588434,"uuid":"195357800","full_name":"samsulmaarif/ansible-gitlab-runner","owner":"samsulmaarif","description":null,"archived":false,"fork":false,"pushed_at":"2020-04-23T03:26:38.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-10T07:03:10.594Z","etag":null,"topics":["ansible","automation","gitlab-ci","gitlab-runner"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"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/samsulmaarif.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}},"created_at":"2019-07-05T07:11:14.000Z","updated_at":"2021-05-17T17:08:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"5f86a993-d8c0-45b8-8fe2-a46a7de95fb8","html_url":"https://github.com/samsulmaarif/ansible-gitlab-runner","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samsulmaarif/ansible-gitlab-runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsulmaarif%2Fansible-gitlab-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsulmaarif%2Fansible-gitlab-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsulmaarif%2Fansible-gitlab-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsulmaarif%2Fansible-gitlab-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samsulmaarif","download_url":"https://codeload.github.com/samsulmaarif/ansible-gitlab-runner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samsulmaarif%2Fansible-gitlab-runner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","automation","gitlab-ci","gitlab-runner"],"created_at":"2024-11-08T16:40:28.882Z","updated_at":"2026-05-15T18:34:11.434Z","avatar_url":"https://github.com/samsulmaarif.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible Playbook to Deploy GitLab Runner\n\nNote that this playbook only tested in openSUSE Leap 15.1 and Ubuntu 18.04\n\n## Prepare the VM/Server\n\nYou should prepare the VM/Server yourself. You could use the `clone.sh` script if you already has VM named `leap15.1` in your KVM Virtualization server.\n\nIf you just install minimal version of openSUSE Leap 15.1, you should install `python` and `python-xml` first. Thus package is needed by the **zypper ansible module**.\n\n```\nansible all -i hosts -m raw -a \"zypper install -y python python-xml\" -u your-leap-user-name --become --become-user root --ask-become-pass\n```\n\n## How to use\n\nClone the repository to local machine/ansible controller:\n\n```\ngit clone URL\ncd directory-name\n```\n\nCopy the required file:\n\n```\ncp  hosts.example hosts\ncp groups_vars/all.yml.example groups_vars/all.yml\n ```\n\nExample of **hosts** file :\n\n```\n[runner]\nrunner01 ansible_host=10.1.1.220\nrunner02 ansible_host=10.1.1.221\nrunner03 ansible_host=10.1.1.222\n```\n\nExample of ansible variable file **all.yml**\n\n```\nrunner_user: gitlab-runner\nrunner_timezone: Asia/Jakarta\nrunner_host_user: samsul\nrunner_registration_token: XXXEy5nG9jHQXXXXXXXX\nrunner_concurrent: 1\nrunner_coordinator_url: https://gitlab.com/\nrunner_description: The runner with the name\nrunner_executor: docker\nrunner_docker_image: alpine\nrunner_tags:\n    - dot\n    - docker\nrunner_path: /usr/local/bin/gitlab-runner\nadditional:\n    node_exporter:\n        deploy: yes\n        version: 0.18.0\n        arch: amd64\n    docker_exporter:\n       deploy: yes\n       port: 9323\n    ctop:\n        deploy: yes\n        version: 0.7.2\n        arch: amd64\n```\n\nRun the playbook\n\n```\nansible-playbook -i hosts main.yml --ask-sudo-pass\n```\ntype the sudo password and press Enter. You can omit the `--ask-sudo-pass` if you already set the sudo without password.\n\nIf anything goes perfectly as expected, now is the time to register our runner. Go to your gitlab instance, either is gitlab.com or your own gitlab instance :\n\n1. in your project/group, go to **Settings** \u003e **CI/CD** \u003e Expand the **Runner** section,\n2. copy your **runner registration token**,\n3. back to your playbook, and open the `groups_vars/all.yml` file,\n4. paste the token next to `runner_registration_token`,\n5. change `runner_coordinator_url` value to your gitlab instance URL if needed, save the file,\n6. go back to your terminal, then run:\n\n```\nansible-playbook -i hosts register-runner.yml --ask-sudo-pass\n```\n7. after the registration is finish, your runner should be available in your gitlab instance.\n\n\n## License\n\n![Creative Commons Attribution 4.0](https://i.creativecommons.org/l/by/4.0/88x31.png)\n\nThis work is licensed under [Creative Commons Attribution 4.0](http://creativecommons.org/licenses/by/4.0/)\n\n## Author\n\nCreated with :heart: by [Samsul Ma'arif](https://github.com/samsulmaarif) for you, yes, you are.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamsulmaarif%2Fansible-gitlab-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamsulmaarif%2Fansible-gitlab-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamsulmaarif%2Fansible-gitlab-runner/lists"}