forked from magellis78/Ansibleplaybooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook13.yml
41 lines (39 loc) · 966 Bytes
/
playbook13.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
---
- name: Install jenkins and required s/w
hosts: jenkinsserver
tasks:
- name: Install required s/w's
apt:
name: "{{item.a}}"
state: present
update_cache: "{{item.b}}"
with_items:
- {a: openjdk-8-jdk,b: yes}
- {a: git,b: no}
- {a: maven,b: no}
- name: Download jenkins.war
get_url:
url: https://get.jenkins.io/war-stable/2.277.1/jenkins.war
dest: /home/ubuntu
- name: Start jenkins
shell: java -jar jenkins.war
- name: Install tomcat9 and required s/w's
hosts: servers
tasks:
- name: Install tomcat9 and tomcat9-admin
apt:
name: "{{item.a}}"
state: present
update_cache: "{{item.b}}"
with_items:
- {a: tomcat9,b: yes}
- {a: tomcat9-admin,b: no}
- name: Copy tomcat-users.xml file
copy:
src: tomcat-users.xml
dest: /etc/tomcat9
- name: Restart tomcat
service:
name: tomcat9
state: restarted
...