-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathtomcat
45 lines (34 loc) · 1.29 KB
/
tomcat
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
---
- name: tomcat Playbook playbook
hosts: "client"
tasks:
- name: checking java and wget
package:
name:
- java-1.8.0-openjdk
- wget
state: present
register: packinstall
- name: checking installation logs
debug: var=packinstall
- name: creating directory
file: path=/opt/tomcat state=directory
- name: downloading tomcat
get_url: url=http://mirror.23media.de/apache/tomcat/tomcat-8/v8.5.29/bin/apache-tomcat-8.5.29.tar.gz dest=/opt/tomcat/
- name: extracting tar
unarchive: src=/opt/tomcat/apache-tomcat-8.5.29.tar.gz dest=/opt/tomcat/ remote_src=yes
- name: changing permission
shell: 'chmod 777 catalina.sh startup.sh shutdown.sh'
args:
chdir: /opt/tomcat/apache-tomcat-8.5.29/bin/
warn: false
- name: downloading sample application
get_url: url=https://tomcat.apache.org/tomcat-8.0-doc/appdev/sample/sample.war dest=/opt/tomcat/apache-tomcat-8.5.29/webapps/
- name: waiting for 30 sec
wait_for: timeout=30
- name: starting tomcat service
shell: 'nohup /opt/tomcat/apache-tomcat-8.5.29/bin/catalina.sh start'
register: checktomcat
- debug: var=checktomcat
- name: service started
debug: msg='Check the tomcat through browser'