Created
May 11, 2020 11:44
-
-
Save ebuildy/bd19d066746085dbacd05a9064df257e to your computer and use it in GitHub Desktop.
Install gitlab-runner with Ansible
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
--- | |
- 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