Skip to content

Instantly share code, notes, and snippets.

@ebuildy
Created May 11, 2020 11: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 ebuildy/bd19d066746085dbacd05a9064df257e to your computer and use it in GitHub Desktop.
Save ebuildy/bd19d066746085dbacd05a9064df257e to your computer and use it in GitHub Desktop.
Install gitlab-runner with Ansible
---
- hosts: recette
become: yes
become_user: root
vars:
gitlab_url: https://XXXXXX
gitlab_runner_registration_token: XXXXX
tasks:
- name: setup user
user:
name: gitlab-runner
comment: Gitlab CI
uid: 1001
create_home: true
groups: ["docker"]
shell: /bin/bash
- name: Download gitlab-runner
get_url:
url : https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
dest: /usr/local/bin/gitlab-runner
mode: 'u+x,g+x'
- name: Install gitlab-runner
shell: |
gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
gitlab-runner start
- name: Register
shell: gitlab-runner register --non-interactive
environment:
RUNNER_TAG_LIST: "exec_shell"
RUNNER_EXECUTOR: shell
CI_SERVER_URL: "{{ gitlab_url }}"
REGISTRATION_TOKEN: "{{ gitlab_runner_registration_token }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment