forked from William-Yeh/ansible-oracle-java
-
Notifications
You must be signed in to change notification settings - Fork 21
/
prefetch.yml
108 lines (85 loc) · 2.34 KB
/
prefetch.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
- hosts: localhost
vars_files:
- 'defaults/main.yml'
tasks:
- name: Overwrite vars from defaults
set_fact:
# java_version: 8
# java_subversion: 201
java_download_path: /tmp/java
java_install_jce: true
download_tar: true
download_rpm: true
download_dmg: true
- name: Make sure download path exists
file:
path: "{{ java_download_path }}"
state: directory
##############
### tar.gz ###
##############
- block:
- name: Set os and architecture
set_fact:
jdk_os: linux
jdk_arch: x64
use_dmg: false
use_rpm: false
use_tarball: true
install_file_extension: tar.gz
jdk_file_name: false
- name: Set jdk variables
import_tasks: tasks/set-jdk-vars.yml
- name: Download from Oracle
import_tasks: tasks/fetch.yml
when: download_tar
##############
### rpm ###
##############
- block:
- name: Set os and architecture
set_fact:
jdk_os: linux
jdk_arch: x64
use_dmg: false
use_rpm: true
use_tarball: false
install_file_extension: rpm
jdk_file_name: false
- name: Set jdk variables
import_tasks: tasks/set-jdk-vars.yml
- name: Download from Oracle
import_tasks: tasks/fetch.yml
when: download_rpm
##############
### dmg ###
##############
- block:
- name: Set OS
set_fact:
jdk_os: macosx
when: java_version == 8
- name: Set OS
set_fact:
jdk_os: osx
when: java_version > 8
- name: Set file attributes
set_fact:
jdk_arch: x64
use_dmg: true
use_rpm: false
use_tarball: false
install_file_extension: dmg
jdk_file_name: false
- name: Set jdk variables
import_tasks: tasks/set-jdk-vars.yml
- name: Download from Oracle
import_tasks: tasks/fetch.yml
when: download_dmg
##############
### JCE ###
##############
- name: Fetch JCE files from Oracle site
import_tasks: tasks/fetch_jce.yml
when: java_install_jce