Ansible playbook for deploying a GAP GitLab CI runner
This playbook is used to install the gitlab-runner package on a VM, and register it as such for a GAP repository of your choice.
Running this playbook
- Provision a VM somewhere, anywhere
- Get the ip address of the new VM, and configure your ssh environment
- Create & activate a python virtual environment and install ansible
- Update inventory.yml so that your VM is defined in the "gitlab-runner" group
- Create the file
group_vars/ci_runners.yml
following the example file given- Consider the type of executor you want/need (docker, shell, etc.)
- More info on GitLab runner executors can be found here
- This requires acquiring an access token to the GitLab instance for which you want to set up a runner
- Consider the type of executor you want/need (docker, shell, etc.)
- Install the
community.general
collection from Ansible galaxy with the following command:ansible-galaxy collection install community.general
- Run the following command to execute the playbook:
ansible-playbook -i inventory.yml playbook.yml
- A new runner should now be available, please ensure that you also set up CI/CD pipelines that make use of this new runner