Skip to content

Instantly share code, notes, and snippets.

@zamoose
Created August 25, 2015 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zamoose/87562389ca63931dfbf8 to your computer and use it in GitHub Desktop.
Save zamoose/87562389ca63931dfbf8 to your computer and use it in GitHub Desktop.
---
- name: Install Gitlab runner repository
copy:
src: etc/yum.repos.d/gitlab-runner.repo
dest: /etc/yum.repos.d/gitlab-runner.repo
tags: [ 'gitlab-runner' ]
- name: Install Gitlab repository GPG key
rpm_key:
state: present
key: https://packages.gitlab.com/gpg.key
tags: [ 'gitlab-runner' ]
- name: Install Gitlab runner packages
yum:
name: gitlab-ci-multi-runner
state: present
tags: [ 'gitlab-runner' ]
- name: Check for Gitlab runner registration
command: cat /etc/gitlab-runner/config.toml
register: gitlab_toml
changed_when: False
tags: [ 'gitlab-runner' ]
- name: Register runner with Gitlab
shell: "gitlab-runner -n -r {{ gitlab_runner_token }} -u {{ gitlab_server_url }} -d {{ inventory_hostname }}"
when: gitlab_toml.stdout.find('token') != -1
tags: [ 'gitlab-runner' ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment