-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook1.yml
55 lines (51 loc) · 1.33 KB
/
playbook1.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
52
53
54
- name: update
hosts: appserver
become_user: root
become: true
tasks:
- name: do a yum update
command: yum update -y
- name: website deployment
hosts: webserver
become_user: root
become: true
tasks:
- name: install httpd server
yum:
name: httpd
state: present
- name: copy website from local to remote
copy:
src: index.html
dest: /var/www/html
- name: start httpd service
service:
name: httpd
state: started
enabled: true
- name: java setup
hosts: appserver
become_user: root
become: true
tasks:
- name: install java
yum: name=java state=latest
- name: app server setup deployment
hosts: appserver
tasks:
- name: download tomcat
get_url:
url: https://mirrors.estointernet.in/apache/tomcat/tomcat-8/v8.5.61/bin/apache-tomcat-8.5.61.tar.gz
dest: /home/ec2-user/
force: no
- name: untar tomcat
unarchive:
src: /home/ec2-user/apache-tomcat-8.5.61.tar.gz
dest: /home/ec2-user/
remote_src: true
- name: copy war file to tomcat directory
copy:
src: /home/ec2-user/Registration.war
dest: /home/ec2-user/apache-tomcat-8.5.61/webapps/
- name: stating tomcat
command: nohup /home/ec2-user/apache-tomcat-8.5.61/bin/startup.sh