Created
August 25, 2015 20:44
-
-
Save zamoose/87562389ca63931dfbf8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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