37 lines
856 B
YAML
37 lines
856 B
YAML
---
|
|
- name: add gpg key
|
|
apt_key:
|
|
url: https://packages.gitlab.com/runner/gitlab-runner/gpgkey
|
|
tags: gitlab-runner
|
|
|
|
- name: add repository
|
|
apt_repository:
|
|
repo: '{{ gitlab_runner_repository }}'
|
|
tags: gitlab-runner
|
|
|
|
- name: install package
|
|
package:
|
|
name: gitlab-runner
|
|
environment:
|
|
GITLAB_RUNNER_DISABLE_SKEL: 'true'
|
|
tags: gitlab-runner
|
|
|
|
- name: register runners
|
|
gitlab_runner:
|
|
name: '{{ item.name }}'
|
|
url: '{{ item.url }}'
|
|
token: '{{ item.token }}'
|
|
executor: '{{ item.executor }}'
|
|
options: '{{ item.options|default({}) }}'
|
|
state: '{{ item.state|default("present") }}'
|
|
loop: '{{ gitlab_runner_runners }}'
|
|
loop_control:
|
|
label: '{{ item.name }}'
|
|
tags: gitlab-runner
|
|
|
|
- name: enable and start service
|
|
service:
|
|
name: gitlab-runner
|
|
state: started
|
|
enabled: true
|
|
tags: gitlab-runner
|