-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathjenkins-server.yml
90 lines (61 loc) · 1.85 KB
/
jenkins-server.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
- hosts: jenkins_server
remote_user: ubuntu
become: yes
tasks:
- name: update apt
apt:
update_cache: yes
- name: Create jenkins_home Directory
file:
name: jenkins_home
state: directory
mode: 0777
- name: Install openjdk
apt:
name: openjdk-8-jdk
state: present
- name: Install the Jenkins apt repository key
apt_key:
url: https://pkg.jenkins.io/debian-stable/jenkins.io.key
state: present
- name: Configure the repository
apt_repository:
repo: 'deb https://pkg.jenkins.io/debian-stable binary/'
state: present
- name: Install Jenkins
apt:
name: jenkins
update_cache: yes
- name: Ensure Jenkins is running
service:
name: jenkins
state: started
- name: Install Git
apt:
name: git
state: present
- name: Install Apache Maven
apt:
name: maven
state: present
- name: Download Apache Maven
get_url:
url: https://www-us.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
dest: /tmp/apache-maven-3.6.3-bin.tar.gz
- name: Untar Maven
shell: chdir=/tmp creates=/opt/apache-maven-3.6.3 tar -zxf apache-maven-3.6.3-bin.tar.gz -C /opt
- name: Update path for maven use
shell: export PATH=/opt/apache-maven-3.6.3/bin:$PATH
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu bionic stable
state: present
- name: Update apt and install docker-ce
apt:
update_cache: yes
name: docker-ce
state: latest