-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
installJenkins.yml
44 lines (44 loc) · 1.2 KB
/
installJenkins.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
- hosts: jenkinsServer
become: yes
tasks:
- name: Download Long Term Jenkins release
get_url:
url: https://pkg.jenkins.io/redhat-stable/jenkins.repo
dest: /etc/yum.repos.d/jenkins.repo
- name: Import jenkins key from url
rpm_key:
state: present
key: https://pkg.jenkins.io/redhat-stable/jenkins.io.key
- name: Install java
yum:
name: java-11-openjdk-devel
state: present
- name: Install Epel Relaase which has daemonize dependency which is required for Jenkins.
yum:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
state: present
disable_gpg_check: true
- name: Install jenkins
yum:
name: jenkins
state: latest
skip_broken: yes
- name: Start Jenkins
service:
name: jenkins
state: started
- name: enable jenkins
systemd:
name: jenkins
enabled: true
- name: sleep for 30 seconds and continue with play
wait_for:
delay: 30
port: 8080
- name: init password jenkin
shell: cat /var/lib/jenkins/secrets/initialAdminPassword
changed_when: false
register: result
- name: print init password jenkins
debug:
var: result.stdout