-
Notifications
You must be signed in to change notification settings - Fork 0
/
tomcat.yml
executable file
·51 lines (51 loc) · 1.21 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
- hosts: kavin
become: yes
become_user: root
vars:
namespace: ansible
tomcat_folder: '/root/apache-tomcat-8.5.31'
java_path: '/opt/jdk-10.0.1'
symlink: '/etc/init.d/tomcat'
tasks:
- name: update
yum: name=*
state: latest
# - name: copy java
# copy:
# src: /root/jdk-10.0.1_linux-x64_bin.tar.gz
# dest: /root/
# - name: extract java
# unarchive:
# src: /root/jdk-10.0.1_linux-x64_bin.tar.gz
# dest: /root/
# mode: 0755
# - name: move java to opt
# shell: cp -r /root/jdk-10.0.1 /opt/
# mode: 0755
# - name: correct java version selected
# alternatives:
# name: java
# path: '{{ java_path }}/bin/java'
# - name: copy tomcat
# copy:
# src: /root/apache-tomcat-8.5.31.tar.gz
# dest: /root/
# - name: extract tomcat
# unarchive:
# src: /root/apache-tomcat-8.5.31.tar.gz
# dest: /root/
- name: Create file for symlink
file:
path: /etc/init.d/tomcat
state: touch
mode: 0755
- name: symlink
file:
src: '{{ tomcat_folder }}/bin/startup.sh'
dest: '{{ symlink }}'
state: link
- name: start tomcat
service:
name: tomcat
state: started