Skip to content

Commit 8603233

Browse files
committed
minor tweaks.
1 parent c841b56 commit 8603233

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ Use `--skip-tags=debug` if you want to suppress debug information.
105105

106106
- v4.7.2 : 24 Aug 2015
107107
- usage of alternatives module to set Java default version on RedHat environments
108+
- updated default version to Java 1.8u60-b27
109+
- improved RPM download task on RedHat environments
110+
- fixed problem with task setting default JDK always flagging itself as changed
108111
- v4.7.0 : 16 Jul 2015
109112
- added support for MacOSX
110113
- minor version number will now match primogen major version number

tasks/darwin/macosx.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,33 @@
77
- name: download DMG file
88
shell:
99
"curl -L -H 'Cookie:oraclelicense=accept-securebackup-cookie' -o {{ oracle_java_dir_source }}/{{ oracle_java_dmg_filename }} {{ oracle_java_dmg_url }}"
10-
when: not oracle_java_task_rpm_check|skipped and not oracle_java_task_rpm_check.stat.exists
10+
when: not oracle_java_task_dmg_check|skipped and not oracle_java_task_dmg_check.stat.exists
1111
args:
1212
creates: "{{ oracle_java_dir_source }}/{{ oracle_java_dmg_filename }}"
1313
tags:
1414
- installation
1515

1616
- name: mount DMG image
17+
shell: echo TODO
1718
tags:
1819
- installation
1920

2021
- name: install JDK
22+
shell: echo TODO
2123
tags:
2224
- installation
2325

2426
- name: unmount DMG image
27+
shell: echo TODO
2528
tags:
2629
- installation
2730

2831
- name: set Java version as default
29-
shell:
32+
shell: echo TODO
3033
when: oracle_java_set_as_default
3134
register: oracle_java_task_set_default
3235
sudo: yes
3336

3437
- name: in case there were changes, check host environment again
3538
include: ../check_environment.yml
39+

tasks/redhat/main.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,40 @@
44
# Task file to install Oracle Java Development Kit in a system with a Redhat based Linux distribution.
55
#
66

7-
- name: in case Java needs to be installed, determine if the RPM needs to be downloaded
8-
stat:
9-
path="{{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }}"
10-
when: not oracle_java_installed or oracle_java_version_installed != oracle_java_version_string
11-
register: oracle_java_task_rpm_check
12-
tags:
13-
- installation
14-
# if {{ not oracle_java_task_rpm_check|skipped }} it means installation is necessary
15-
16-
- debug:
17-
msg="tmp_rpm_check={{ oracle_java_task_rpm_check }}"
18-
tags:
19-
- debug
20-
217
- name: download Java RPM
228
shell:
239
"curl -L -H 'Cookie:oraclelicense=accept-securebackup-cookie' -o {{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }} {{ oracle_java_rpm_url }}"
24-
when: not oracle_java_task_rpm_check|skipped and not oracle_java_task_rpm_check.stat.exists
10+
args:
11+
creates: "{{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }}"
12+
register: oracle_java_task_rpm_download
2513
sudo: yes
2614
tags:
2715
- installation
2816

2917
- name: install RPM
30-
shell:
31-
"rpm --force -ivh {{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }}"
32-
when: not oracle_java_task_rpm_check|skipped
18+
yum:
19+
name="{{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }}"
20+
state=present
21+
when: not oracle_java_task_rpm_download|skipped
3322
sudo: yes
3423
tags:
3524
- installation
3625

3726
- name: set Java version as default
3827
alternatives:
39-
name=java
40-
link=/usr/bin/java
41-
path="{{ oracle_java_home }}/jre/bin/java"
28+
name="{{ item.exe }}"
29+
link="/usr/bin/{{ item.exe }}"
30+
path="{{ item.path }}/{{ item.exe }}"
4231
when: oracle_java_set_as_default
32+
with_items:
33+
- { path: "{{ oracle_java_home }}/jre/bin", exe: 'java' }
34+
- { path: "{{ oracle_java_home }}/jre/bin", exe: 'keytool' }
35+
- { path: "{{ oracle_java_home }}/bin", exe: 'javac' }
36+
- { path: "{{ oracle_java_home }}/bin", exe: 'javadoc' }
4337
sudo: yes
38+
when: oracle_java_task_rpm_download|changed or (oracle_java_installed and oracle_java_version_installed != oracle_java_version_string)
4439
register: oracle_java_task_set_default
4540

4641
- name: in case there were changes, check host environment again
4742
include: ../check_environment.yml
48-
when: not oracle_java_task_rpm_check|skipped or oracle_java_task_set_default|changed
43+
when: not oracle_java_task_rpm_download|skipped or oracle_java_task_set_default|changed

0 commit comments

Comments
 (0)