Skip to content
Snippets Groups Projects

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

  1. Provision a VM somewhere, anywhere
  2. Get the ip address of the new VM, and configure your ssh environment
  3. Create & activate a python virtual environment and install ansible
  4. Update inventory.yml so that your VM is defined in the "gitlab-runner" group
  5. 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
  6. Install the community.general collection from Ansible galaxy with the following command: ansible-galaxy collection install community.general
  7. Run the following command to execute the playbook: ansible-playbook -i inventory.yml playbook.yml
  8. A new runner should now be available, please ensure that you also set up CI/CD pipelines that make use of this new runner