forked from yankils/ansible_for_beginners
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-tomcat.yml
37 lines (32 loc) · 865 Bytes
/
setup-tomcat.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
---
- name: setup tomcat
hosts: all
become: true
tasks:
- name: install java
yum:
name: java
state: installed
when: ansible_os_family == "RedHat"
- name: install java on ubuntu
apt:
name: default-jdk
state: present
when: ansible_os_family == "Debian"
- name: download tomcat packages
get_url:
url: http://mirrors.estointernet.in/apache/tomcat/tomcat-8/v8.5.50/bin/apache-tomcat-8.5.50.tar.gz
dest: /opt
- name: untar apache packages
unarchive:
src: /opt/apache-tomcat-8.5.50.tar.gz
dest: /opt
remote_src: yes
- name: add execution permissions on startup.sh file
file:
path: /opt/apache-tomcat-8.5.50/bin/startup.sh
mode: 0777
- name: start tomcat services
shell: nohup ./startup.sh
args:
chdir: /opt/apache-tomcat-8.5.50/bin