-
Notifications
You must be signed in to change notification settings - Fork 7
/
tomcat-setup.yaml
37 lines (30 loc) · 945 Bytes
/
tomcat-setup.yaml
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
---
- hosts: all
become: yes
tasks:
- name: Update and upgrade apt packages
apt:
upgrade: yes
update_cache: yes
cache_valid_time: 86400 #One day
- name: install JDK 11
apt:
name: openjdk-11-jdk
state: present
- name: create /opt/tomcat directory
file:
path: /opt/tomcat
state: directory
mode: 0755
- name: download & unarchive
unarchive:
src: http://apache.cs.utah.edu/tomcat/tomcat-9/v9.0.52/bin/apache-tomcat-9.0.52.tar.gz
dest: /opt/tomcat
remote_src: yes
extra_opts: [--strip-components=1]
- name: Copy the tomcat-users.xml file from master to remote host
copy: src=tomcat-users.xml dest=/opt/tomcat/conf/
- name: Copy the context.xml file from master to remote host
copy: src=context.xml dest=/opt/tomcat/webapps/manager/META-INF/
- name: Start and enable Tomcat service
shell: nohup /opt/tomcat/bin/startup.sh