diff --git a/tasks/install-debian.yml b/tasks/install-debian.yml new file mode 100644 index 0000000000000000000000000000000000000000..4145878b075aec26df667cc82ec13533869aefce --- /dev/null +++ b/tasks/install-debian.yml @@ -0,0 +1,24 @@ +--- +- name: Add GitLab apt key + apt_key: + url: https://packages.gitlab.com/gpg.key + state: present + +- name: Install GitLab Runner dependencies + apt: + name: '{{ item }}' + state: present + with_items: + - debian-archive-keyring + - apt-transport-https + +- name: Add GitLab Runner apt repo + apt_repository: + repo: 'deb https://packages.gitlab.com/runner/gitlab-ci-multi-runner/{{ ansible_distribution | lower }}/ {{ ansible_distribution_major_version }} main' + state: present + +- name: Install GitLab Runner + apt: + name: gitlab-ci-multi-runner + state: latest + update_cache: yes diff --git a/tasks/main.yml b/tasks/main.yml index 064596d35060f87150784da081f406e5c4c11d38..6d964db158b6d53516312870fc85002fce194ac4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,8 @@ --- +- name: Install GitLab Runner (Debian) + include: install-debian.yml + when: ansible_os_family == 'Debian' + - name: Install GitLab Runner (RedHat) include: install-redhat.yml when: ansible_os_family == 'RedHat'