forked from javahometech/9amdevopsjan2019
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tomcat.yml
39 lines (39 loc) · 952 Bytes
/
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
---
- hosts: webservers
become: True
tasks:
- name: Install tomcat
yum:
name: tomcat
state: present
- name: Install Git
yum:
name: git
state: present
- name: Start tomcat
service:
name: tomcat
state: started
- name: Enable tomcat on reboot
service:
name: tomcat
enabled: yes
- name: create directory under tomcat webapps
file:
path: /usr/share/tomcat/webapps/ROOT
state: directory
- name: Take website from git and deploy
git:
repo: https://github.com/javahometech/javahome-app
dest: /usr/share/tomcat/webapps/ROOT/
- name: Update port number of tomcat
template:
src: server.xml.j2
dest: /usr/share/tomcat/conf/server.xml
notify:
- Restart tomcat
handlers:
- name: Restart tomcat
service:
name: tomcat
state: restarted