-
Notifications
You must be signed in to change notification settings - Fork 1
/
playbook.yml
55 lines (47 loc) · 1.4 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- hosts: all
vars_prompt:
- name: "gitlabci_token"
prompt: "Gitlab-runner Token: "
remote_user: ubuntu
become: yes
tasks:
- apt:
update_cache: yes
name: "{{ item }}"
loop:
- cmake
- git
- wget
- name: Docker ppa key
apt_key:
url: https://download.docker.com/linux/{{ansible_distribution | lower}}/gpg
state: present
- name: Add Docker APT repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/{{ansible_distribution | lower}} {{ansible_distribution_release}} stable
- name: Docker
apt:
name: docker-ce
- name: Posix users which can use docker
user:
name: "{{ ansible_user }}"
groups:
- docker
- name: gitlab
get_url:
url: https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh
dest: /tmp/gitlab_script.sh
- name: install gitlab runner
shell: bash /tmp/gitlab_script.sh
- name: gitlab Community edition
apt:
name: gitlab-runner
- name: Register runner to GitLab
command: gitlab-runner register >
--non-interactive
--url "https://gitlab.com/"
--registration-token '{{ gitlabci_token }}'
--description "gitlab_runner for the NLeSC-JCER projects"
--executor "docker"
--docker-image alpine:3