-
Notifications
You must be signed in to change notification settings - Fork 1
/
CentOS7x_Install-Jenkins-playbook.yml
611 lines (492 loc) · 22.7 KB
/
CentOS7x_Install-Jenkins-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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
---
################################################################################
# description: Installs Jenkins on CentOS7x
# usage: ansible-playbook CentOS7x_Install-Jenkins-playbook.yml --extra-vars 'HostOrGroup=YourServerOrGroupNameGoesHere'
# author: Ernest G. Wilson II <[email protected]> (https://github.com/ernestgwilsonii)
# license: MIT
################################################################################
# Ansible Playbook options
# REF: http://docs.ansible.com/ansible/playbooks.html
#####################################################
- name: Install Jenkins on CentOS7x
hosts: "{{ HostOrGroup|default ('FATAL ERROR --> HostOrGroup NOT SET! You must specify either a Host or a Group name!') }}"
serial: "100%"
gather_facts: False
tasks:
# Install yum packages
# REF: http://docs.ansible.com/ansible/yum_module.html
######################################################
- name: Install the Java JRE runtime java
yum:
name: java-1.8.0-openjdk
state: latest
- name: Install the Java JDK compiler javac
yum:
name: java-1.8.0-openjdk-devel
state: latest
- name: Install Groovy language for Java
yum:
name: groovy
state: latest
- name: Install git
yum:
name: git
state: latest
# Update various configuration files
# REF: http://docs.ansible.com/ansible/lineinfile_module.html
#############################################################
- name: Set JAVA_HOME environment variable for root on next login
lineinfile:
dest: /root/.bash_profile
state: present
line: 'export JAVA_HOME=/usr/lib/jvm/java-openjdk'
- name: Set JRE_HOME environment variable for root on next login
lineinfile:
dest: /root/.bash_profile
state: present
line: 'export JRE_HOME=/usr/lib/jvm/java-openjdk/jre'
- name: Add Java to the path for root on next login
lineinfile:
dest: /root/.bash_profile
state: present
line: 'export PATH=$PATH:/usr/lib/jvm/java-openjdk/bin:/usr/lib/jvm/java-openjdk/jre/bin'
# Restart firewalld to make sure it is running OK before changing any rules
# REF: http://docs.ansible.com/ansible/service_module.html
##########################################################
- name: Ensure the firewalld service is enabled and re-started before changing any rules
service:
name: firewalld
enabled: yes
state: restarted
# Update the firewalld configuration
# REF: http://docs.ansible.com/ansible/firewalld_module.html
############################################################
- name: Update firewall to allow port TCP 8080 for incoming Jenkins HTTP connections
firewalld:
port: 8080/tcp
permanent: true
immediate: yes
state: enabled
zone: public
- name: Update firewall to allow port TCP 49187 for incoming Jenkins JNLP connections
firewalld:
port: 49187/tcp
permanent: true
immediate: yes
state: enabled
zone: public
# Install or configure repository used on the OS by yum
# REF: https://docs.ansible.com/ansible/yum_repository_module.html
##################################################################
# /etc/yum.repos.d/jenkins.repo
- name: Install repository Jenkins
yum_repository:
name: Jenkins
description: Jenkins repository
file: jenkins
baseurl: http://pkg.jenkins.io/redhat
enabled: yes
gpgcheck: yes
gpgkey: https://pkg.jenkins.io/redhat/jenkins.io.key
# Install yum packages
# REF: http://docs.ansible.com/ansible/yum_module.html
######################################################
- name: Install Jenkins
yum:
name: jenkins
state: latest
# Enable and start Jenkins service
# REF: http://docs.ansible.com/ansible/service_module.html
##########################################################
- name: Enable and start Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 30
# wait_for - Waits for a condition before continuing
# REF: http://docs.ansible.com/ansible/wait_for_module.html
###########################################################
- name: Wait for file to exist before continuing /var/lib/jenkins/config.xml
wait_for:
path: /var/lib/jenkins/config.xml
- name: Wait for file to exist before continuing /var/lib/jenkins/users/admin/config.xml
wait_for:
path: /var/lib/jenkins/users/admin/config.xml
- name: Wait for file to exist before continuing /var/lib/jenkins/secrets/initialAdminPassword
wait_for:
path: /var/lib/jenkins/secrets/initialAdminPassword
# Register Variables
# REF: http://docs.ansible.com/ansible/playbooks_conditionals.html#register-variables
#####################################################################################
- name: Get the autogenerated default starting admin password via cat /var/lib/jenkins/secrets/initialAdminPassword
shell: cat /var/lib/jenkins/secrets/initialAdminPassword
register: jenkins_default_admin_password
- debug: msg="Default starting Jenkins password {{jenkins_default_admin_password.stdout}}"
# lineinfile - Ensure a particular line is in a file, or replace an existing line using a back-referenced regular expression
# REF: http://docs.ansible.com/ansible/lineinfile_module.html
#############################################################
- name: Configure Jenkins service to skip the setup wizard
lineinfile:
dest: /etc/sysconfig/jenkins
regexp: '^JENKINS_JAVA_OPTIONS='
line: 'JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Djenkins.install.runSetupWizard=false"'
# Restart Jenkins service
# REF: http://docs.ansible.com/ansible/service_module.html
##########################################################
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
# cat /var/lib/jenkins/secrets/initialAdminPassword
# wait_for - Waits for a condition before continuing
# REF: http://docs.ansible.com/ansible/wait_for_module.html
###########################################################
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 30
# command - Executes a command on a remote node
# REF: http://docs.ansible.com/ansible/command_module.html
##########################################################
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ list-plugins --username admin --password keyhere
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin git -restart --username admin --password keyhere
- name: Install Jenkins plugin git
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin git -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/git
ignore_errors: yes
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin github -restart --username admin --password keyhere
- name: Install Jenkins plugin github
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin github -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/github
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin github-oauth -restart --username admin --password keyhere
- name: Install Jenkins plugin github-oauth
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin github-oauth -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/github-oauth
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin ansible -restart --username admin --password keyhere
- name: Install Jenkins plugin ansible
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin ansible -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/ansible
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin slack -restart --username admin --password keyhere
- name: Install Jenkins plugin slack
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin slack -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/slack
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin slack-uploader -restart --username admin --password keyhere
- name: Install Jenkins plugin slack-uploader
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin slack-uploader -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/slack-uploader
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin pagerduty -restart --username admin --password keyhere
- name: Install Jenkins plugin pagerduty
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin pagerduty -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/pagerduty
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin disk-usage -restart --username admin --password keyhere
- name: Install Jenkins plugin disk-usage
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin disk-usage -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/disk-usage
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin docker-plugin -restart --username admin --password keyhere
- name: Install Jenkins plugin docker-plugin
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin docker-plugin -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/docker-plugin
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin audit-trail -restart --username admin --password keyhere
- name: Install Jenkins plugin audit-trail
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin audit-trail -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/audit-trail
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin global-build-stats -restart --username admin --password keyhere
- name: Install Jenkins plugin global-build-stats
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin global-build-stats -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/global-build-stats
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin build-metrics -restart --username admin --password keyhere
- name: Install Jenkins plugin build-metrics
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin build-metrics -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/build-metrics
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin configurationslicing -restart --username admin --password keyhere
- name: Install Jenkins plugin configurationslicing
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin configurationslicing -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/configurationslicing
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin matrix-auth -restart --username admin --password keyhere
- name: Install Jenkins plugin matrix-auth
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin matrix-auth -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/matrix-auth
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin greenballs -restart --username admin --password keyhere
- name: Install Jenkins plugin greenballs
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin greenballs -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/greenballs
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin gravatar -restart --username admin --password keyhere
- name: Install Jenkins plugin gravatar
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin gravatar -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/gravatar
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin job-dsl -restart --username admin --password keyhere
- name: Install Jenkins plugin job-dsl
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin job-dsl -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/job-dsl
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin jobConfigHistory -restart --username admin --password keyhere
- name: Install Jenkins plugin jobConfigHistory
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin jobConfigHistory -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/jobConfigHistory
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin nodejs -restart --username admin --password keyhere
- name: Install Jenkins plugin nodejs
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin nodejs -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/nodejs
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin timestamper -restart --username admin --password keyhere
- name: Install Jenkins plugin timestamper
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin timestamper -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/timestamper
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin scm-sync-configuration -restart --username admin --password keyhere
- name: Install Jenkins plugin scm-sync-configuration
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin scm-sync-configuration -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/scm-sync-configuration
- name: Restart Jenkins service
service:
name: jenkins
enabled: yes
state: restarted
- name: Wait for Jenkins TCP port 8080 to respond before moving on
wait_for:
host: localhost
port: 8080
delay: 20
# java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin thinBackup -restart --username admin --password keyhere
- name: Install Jenkins plugin thinBackup
command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin thinBackup -restart --username admin --password {{jenkins_default_admin_password.stdout}}
args:
creates: /var/lib/jenkins/plugins/thinBackup
- name: Restart Jenkins service one last time!
service:
name: jenkins
enabled: yes
state: restarted
- debug: msg="** You may now login to Jenkins at http://{{ansible_ssh_host}}:8080 with username admin and password {{jenkins_default_admin_password.stdout}} **"
# Possible future Jenkins plugins
#################################
# # java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://IPHere:8080/ install-plugin build-pipeline-plugin -restart --username admin --password keyhere
# - name: Install Jenkins plugin blueocean
# command: /usr/bin/java -jar /var/cache/jenkins/war/WEB-INF/jenkins-cli.jar -s http://localhost:8080/ install-plugin blueocean -restart --username admin --password {{jenkins_default_admin_password.stdout}}
# args:
# creates: /var/lib/jenkins/plugins/blueocean