forked from Muthukumar-sys/https-github.com-AnisblePlayBooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installJenkins.yml
54 lines (44 loc) · 1.05 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
45
46
47
48
49
50
51
52
53
54
---
- hosts: appServers
gather_facts: false
become: true
tasks:
- name: install wget
yum:
name: wget
state: present
- name: install openjdk
yum:
name: java-1.8.0-openjdk
state: present
- name: download jenkins.repo
get_url:
url: http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
dest: /etc/yum.repos.d/jenkins.repo
- name: import jenkins key
rpm_key:
state: present
key: https://jenkins-ci.org/redhat/jenkins-ci.org.key
- name: install jenkins
yum:
name: jenkins
state: present
- name: start jenkins
systemd:
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