-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_tomcat.yaml
More file actions
42 lines (35 loc) · 1 KB
/
update_tomcat.yaml
File metadata and controls
42 lines (35 loc) · 1 KB
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
---
########### Download Tomcat from S3 Bucket #############
- name: import files from s3
command: aws s3 cp s3://{{ s3_bucket }}/{{ item }} /tmp/{{ item }} creates=/tmp/{{ item }}
with_items:
- apache-tomcat-{{ tomcat_version }}.tar.gz
# become_user: ec2-user
############## Remove existing Tomcat ####################
- name: Check if tomcat link Exists
stat:
path: /opt/tomcat
register: tomcat_sym
- name: Remove old Tomcat
file:
path: /opt/tomcat
state: absent
when: tomcat_sym.stat.islnk is defined and tomcat_sym.stat.islnk == False
become: yes
############## Tomcat Installation #######################
- name: extract tomcat
unarchive:
src: /tmp/apache-tomcat-{{ tomcat_version }}.tar.gz
dest: /opt
owner: "{{ ve_user }}"
group: "{{ ve_user }}"
remote_src: yes
become: yes
- name: create tomcat link
file:
src: /opt/{{ tomcat_dir }}
dest: /opt/tomcat
owner: "{{ ve_user }}"
group: "{{ ve_user }}"
state: link
become: yes