diff --git a/tasks/install-redhat.yml b/tasks/install-redhat.yml new file mode 100644 index 0000000000000000000000000000000000000000..c875d2210331124e637b8adffa211a7c36561b98 --- /dev/null +++ b/tasks/install-redhat.yml @@ -0,0 +1,19 @@ +--- +- name: Install GitLab Runner dependencies + yum: + name: '{{ item }}' + state: present + with_items: + - pygpgme + - yum-utils + +- 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 + +- name: Install GitLab Runner + yum: + name: gitlab-ci-multi-runner + state: latest + update_cache: yes diff --git a/tasks/main.yml b/tasks/main.yml index 11511234cb911484c11a9fe8341b7622b6a05751..d0904b5423a37274dabaf7b96a86055d774ccf0b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,2 +1,4 @@ --- -# tasks file for gitlab-runner +- name: Install GitLab Runner (RedHat) + include: install-redhat.yml + when: ansible_os_family == 'RedHat' diff --git a/templates/runner_gitlab-ci-multi-runner.repo.j2 b/templates/runner_gitlab-ci-multi-runner.repo.j2 new file mode 100644 index 0000000000000000000000000000000000000000..6964c0a81d034f83433f25fc989cb11887d7543b --- /dev/null +++ b/templates/runner_gitlab-ci-multi-runner.repo.j2 @@ -0,0 +1,19 @@ +[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 +repo_gpgcheck=1 +gpgcheck=0 +enabled=1 +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 +repo_gpgcheck=1 +gpgcheck=0 +enabled=1 +gpgkey=https://packages.gitlab.com/gpg.key +sslverify=1 +sslcacert=/etc/pki/tls/certs/ca-bundle.crt