-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_java.yaml
More file actions
40 lines (34 loc) · 923 Bytes
/
update_java.yaml
File metadata and controls
40 lines (34 loc) · 923 Bytes
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
---
########### Download Java from S3 Bucket #############
- name: import files from s3
command: aws s3 cp s3://{{ s3_bucket }}/{{ item }} /tmp/{{ item }} creates=/tmp/{{ item }}
with_items:
- jdk-{{ java_version }}-linux-x64.tar.gz
############## Remove existing Java ####################
- name: Check if java link Exists
stat:
path: /opt/java
register: java_sym
- name: Remove old Java Directory
file:
path: /opt/java
state: absent
when: java_sym.stat.islnk is defined and java_sym.stat.islnk == False
become: yes
############## Java Installation #######################
- name: extract java
unarchive:
src: /tmp/jdk-{{ java_version }}-linux-x64.tar.gz
dest: /opt
owner: root
group: root
remote_src: yes
become: yes
- name: create java link
file:
src: /opt/{{ java_dir }}
dest: /opt/java
owner: root
group: root
state: link
become: yes