debops/debops-playbooks

Proposed role: GitLab Runner

Gomez opened this issue · 4 comments

Gomez commented

Gitlab 8.0 merges gitlab-ci into it. Now a Gitlab Runner is needed as role. Installation docs:
https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/linux-repository.md

Yup, might be good idea. I thought about creating debops.gitlab_ci_multi_runner, but now that GitLab CI is merged with GitLab proper I suppose there's no need, and trimming the name to debops.gitlab_runner will make things easier to maintain. Old roles should be kept around for some time to allow for upgrades.

Gomez commented

AFAIK @scibi is already working on the gitlab_runner. I am happy to test it and we will report back to you.

This might serve as a starting point:

- name: Debian | Installing dependencies
  apt: name={{item}} state=present update_cache=yes cache_valid_time=3600
  with_items:
    - debian-archive-keyring
    - apt-transport-https

- name: Debian | Configuring gitlab repository key
  apt_key:
    state: present
    data: "{{ lookup('file', 'gpg.key') }}"

- name: Debian | Configuring gitlab repository
  apt_repository:
      repo:  "deb http://packages.gitlab.com/runner/gitlab-ci-multi-runner/ubuntu/ {{ ansible_distribution_release }} main"
      state: present
  register: gitlab_apt_repo

- name: Debian | update package list for gitlab runner
  apt: update_cache=yes
  when: gitlab_apt_repo|changed

- name: Debian | Installing gitlab-runner-ci
  apt: name=gitlab-ci-multi-runner   state=present

note that it has ubuntu hard coded. It also doesn't register the runner.