forked from MithunTechnologiesDevOps/maven-web-application
-
Notifications
You must be signed in to change notification settings - Fork 1
/
appdeploy.yaml
32 lines (32 loc) · 900 Bytes
/
appdeploy.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
---
- hosts: all
become: true
tasks:
- name: stop tomcat
systemd:
name: tomcat.service
state: stopped
- name: delete old application package
file:
path: /usr/local/apache-tomcat-7.0.76/webapps/maven-web-application.war
state: absent
- name: copy application package
copy:
src: target/maven-web-application.war
dest: /usr/local/apache-tomcat-7.0.76/webapps/maven-web-application.war
owner: tomcat
group: tomcat
- name: start tomcat
systemd:
name: tomcat.service
state: started
daemon_reload: yes
enabled: yes
- name: Pause for 1 Minute and continue with play
pause:
minutes: 1
- name: Confirm that 200 OK response is returned
uri:
url: "http://{{ ansible_host }}:8080/maven-web-application/"
status_code: 200
...