-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
62 lines (53 loc) · 1.53 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
56
57
58
59
60
61
62
---
- hosts: 127.0.0.1
connection: local
become: true
become_user: root
gather_facts: false
tasks:
- name: Install Java-8
apt:
name: openjdk-8-jdk
update_cache: yes
- name: Add Jenkins key
apt_key:
url: https://pkg.jenkins.io/debian/jenkins.io.key
- name: Add Jenkins repo
apt_repository:
repo: deb http://pkg.jenkins.io/debian-stable binary/
state: present
filename: jenkins
- name: Install Jenkins
apt:
name: jenkins
update_cache: yes
- name: Install packages needed for Docker
vars:
list_of_pkgs: ['apt-transport-https', 'ca-certificates', 'curl', 'software-properties-common', 'python3-pip', 'virtualenv', 'python3-setuptools']
apt:
name: "{{ list_of_pkgs }}"
state: latest
update_cache: yes
- name: Add Docker GPG key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
- name: Add Docker repo
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu bionic stable
state: present
- name: Install Docker
vars:
list_of_pkgs: ['docker-ce', 'docker-ce-cli', 'containerd.io']
apt:
name: "{{ list_of_pkgs }}"
update_cache: yes
- name: Create Docker group
group:
name: docker
state: present
- name: Add Jenkins to docker group
user:
name: jenkins
groups: docker
append: yes