Commit e34ba702 authored by Paul B's avatar Paul B

package_name: make it possible to latest versions since gitlab 10.0

parent 46604a85
GitLab Runner [![Build Status](https://api.travis-ci.org/riemers/ansible-gitlab-runner.svg?branch=master)](https://travis-ci.org/riemers/ansible-gitlab-runner) [![Ansible Role](https://img.shields.io/badge/role-riemers.gitlab--runner-blue.svg?maxAge=2592000)](https://galaxy.ansible.com/riemers/gitlab-runner/)
=============
This role will install the [official GitLab Runner](https://gitlab.com/gitlab-org/gitlab-ci-multi-runner)
This role will install the [official GitLab Runner](https://gitlab.com/gitlab-org/gitlab-runner)
(fork from haroldb) with updates. Needed something simple and working, this did the trick for me. Open for changes though.
Requirements
......@@ -12,6 +12,9 @@ This role requires Ansible 2.0 or higher.
Role Variables
--------------
`gitlab_runner_package_name`
**Since Gitlab 10.x** The package name of `gitlab-ci-multi-runner` has been renamed to `gitlab-runner`. In order to install a version >= 10.x you will need to define this variable `gitlab_runner_package_name: gitlab-runner`.
`gitlab_runner_concurrent`
The maximum number of jobs to run concurrently.
Defaults to the number of processor cores.
......
---
# Change this variable value to 'gitlab-runner' for versions >= 10.x
gitlab_runner_package_name: 'gitlab-ci-multi-runner'
# Maximum number of jobs to run concurrently
gitlab_runner_concurrent: '{{ ansible_processor_cores }}'
......
......@@ -2,7 +2,7 @@
- name: Get Gitlab repository installation script
get_url:
url: https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh
url: "https://packages.gitlab.com/install/repositories/runner/{{ gitlab_runner_package_name }}/script.deb.sh"
dest: /tmp/gitlab-runner.script.deb.sh
mode: 0744
......@@ -11,16 +11,16 @@
become: true
- set_fact:
gitlab_runner_package_name: "gitlab-ci-multi-runner={{ gitlab_runner_package_version }}"
gitlab_runner_package: "{{ gitlab_runner_package_name }}={{ gitlab_runner_package_version }}"
gitlab_runner_package_state: "present"
when: gitlab_runner_package_version is defined
- set_fact:
gitlab_runner_package_name: "gitlab-ci-multi-runner"
gitlab_runner_package: "{{ gitlab_runner_package_name }}"
gitlab_runner_package_state: "latest"
when: gitlab_runner_package_version is not defined
- name: Install GitLab Runner
apt:
name: "{{ gitlab_runner_package_name }}"
name: "{{ gitlab_runner_package }}"
state: "{{ gitlab_runner_package_state }}"
......@@ -19,11 +19,11 @@
- name: Add GitLab Runner rpm repo
template:
src: runner_gitlab-ci-multi-runner.repo.j2
dest: /etc/yum.repos.d/runner_gitlab-ci-multi-runner.repo
src: "runner.repo.j2"
dest: "/etc/yum.repos.d/runner_{{ gitlab_runner_package_name }}.repo"
- name: Install GitLab Runner
yum:
name: gitlab-ci-multi-runner
name: "{{ gitlab_runner_package_name }}"
state: latest
update_cache: yes
[runner_gitlab-ci-multi-runner]
name=runner_gitlab-ci-multi-runner
baseurl=https://packages.gitlab.com/runner/gitlab-ci-multi-runner/el/{{ ansible_distribution_major_version }}/$basearch
[runner_{{ gitlab_runner_package_name }}]
name=runner_{{ gitlab_runner_package_name }}
baseurl=https://packages.gitlab.com/runner/{{ gitlab_runner_package_name }}/el/{{ ansible_distribution_major_version }}/$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
......@@ -8,9 +8,9 @@ gpgkey=https://packages.gitlab.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
[runner_gitlab-ci-multi-runner-source]
name=runner_gitlab-ci-multi-runner-source
baseurl=https://packages.gitlab.com/runner/gitlab-ci-multi-runner/el/{{ ansible_distribution_major_version }}/SRPMS
[runner_{{ gitlab_runner_package_name }}-source]
name=runner_{{ gitlab_runner_package_name }}-source
baseurl=https://packages.gitlab.com/runner/{{ gitlab_runner_package_name }}/el/{{ ansible_distribution_major_version }}/SRPMS
repo_gpgcheck=1
gpgcheck=0
enabled=1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment