ansible-role-gitlab_runner/tasks/main.yml

39 lines
928 B
YAML
Raw Normal View History

2020-08-09 06:20:33 +00:00
---
- name: add gpg key
2022-04-07 13:15:48 +00:00
ansible.builtin.apt_key:
2020-08-09 06:20:33 +00:00
url: https://packages.gitlab.com/runner/gitlab-runner/gpgkey
tags: gitlab-runner
- name: add repository
2022-04-07 13:15:48 +00:00
ansible.builtin.apt_repository:
2020-08-09 06:20:33 +00:00
repo: '{{ gitlab_runner_repository }}'
tags: gitlab-runner
- name: install package
2022-04-07 13:15:48 +00:00
ansible.builtin.package:
name:
- gitlab-runner
2020-08-09 06:20:33 +00:00
environment:
GITLAB_RUNNER_DISABLE_SKEL: 'true'
tags: gitlab-runner
- name: register runners
2022-04-07 13:20:10 +00:00
gitlab_runner:
2020-08-09 06:20:33 +00:00
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
2022-04-07 13:15:48 +00:00
ansible.builtin.service:
2020-08-09 06:20:33 +00:00
name: gitlab-runner
state: started
enabled: true
tags: gitlab-runner