File tree Expand file tree Collapse file tree 8 files changed +24
-19
lines changed Expand file tree Collapse file tree 8 files changed +24
-19
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ DISCLAIMER: usage of any version of this role implies you have accepted the
5353| oracle_java_version_update | 45 | the Oracle JDK version update. |
5454| oracle_java_version_build | 14 | the Oracle JDK version update build number. |
5555| oracle_java_version_string | 1.{{ oracle_java_version }}.0_u{{ oracle_java_version_update }} | the Java version string to verify installation against. |
56+ | oracle_java_os_supported variable | - | role internal variable to check if a OS family is supported or not. |
57+
5658
5759### Debian-only
5860
Original file line number Diff line number Diff line change 1+ ---
2+ # file: oracle-java/defaults/darwin.yml
3+ #
4+ # Default variables for Darwin-based distributions.
5+ #
6+
7+ oracle_java_os_supported : no
Original file line number Diff line number Diff line change 77launchpad_ppa_webupd8_cache_valid_time : 3600
88
99oracle_java_cache_valid_time : " {{ launchpad_ppa_webupd8_cache_valid_time }}"
10- oracle_java_state : latest
1110
1211oracle_java_home : " /usr/lib/jvm/java-{{ oracle_java_version }}-oracle"
12+
13+ oracle_java_os_supported : yes
14+
15+ oracle_java_state : latest
Original file line number Diff line number Diff line change 66
77oracle_java_home : " /usr/java/jdk1.{{ oracle_java_version }}.0_{{ oracle_java_version_update }}"
88
9+ oracle_java_os_supported : yes
10+
911oracle_java_rpm_filename : " jdk-{{ oracle_java_version }}u{{ oracle_java_version_update }}-linux-x64.rpm"
1012oracle_java_rpm_url : " http://download.oracle.com/otn-pub/java/jdk/{{ oracle_java_version }}u{{ oracle_java_version_update }}-b{{ oracle_java_version_build }}/{{ oracle_java_rpm_filename }}"
Original file line number Diff line number Diff line change 44# Task file to install Oracle Java Development Kit in a system with a Debian based Linux distribution.
55#
66
7- - name : debian is supported
8- set_fact :
9- oracle_java_os_supported : yes
10-
11-
12- # installation
13-
147- name : accept Oracle license
158 shell : " echo oracle-java{{ oracle_java_version }}-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections"
169 changed_when : no
Original file line number Diff line number Diff line change 2424 msg="oracle_java_home={{ oracle_java_home }}"
2525 when : oracle_java_home is defined
2626
27+ - name : echo oracle_java_os_supported
28+ debug :
29+ msg="oracle_java_os_supported={{ oracle_java_os_supported }}"
30+ when : oracle_java_os_supported is defined
31+
2732- name : echo oracle_java_rpm_url
2833 debug :
2934 msg="oracle_java_rpm_url={{ oracle_java_rpm_url }}"
Original file line number Diff line number Diff line change 1212- name : include OS family/distribution specific variables
1313 include_vars : " {{ item }}"
1414 with_first_found :
15- - " ../defaults/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
16- - " ../defaults/{{ ansible_distribution }}.yml"
17- - " ../defaults/{{ ansible_os_family }}.yml"
15+ - " ../defaults/{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
16+ - " ../defaults/{{ ansible_distribution | lower }}.yml"
17+ - " ../defaults/{{ ansible_os_family | lower }}.yml"
1818
1919- name : debug variables
2020 include : debug.yml
3434- name : check if operating system is suported
3535 fail :
3636 msg : " The operating system ({{ ansible_os_family }}) of the target machine ({{ inventory_hostname }}) is not currently supported."
37- when : oracle_java_os_supported is not defined
37+ when : oracle_java_os_supported is not defined or not oracle_java_os_supported
Original file line number Diff line number Diff line change 44# Task file to install Oracle Java Development Kit in a system with a Redhat based Linux distribution.
55#
66
7- - name : redhat is supported
8- set_fact :
9- oracle_java_os_supported : yes
10-
11-
12- # installation
13-
147- name : in case Java needs to be installed, determine if the RPM needs to be downloaded
158 stat :
169 path="{{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }}"
You can’t perform that action at this time.
0 commit comments