Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only start download, if there is a different version then installed #103

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions tasks/darwin/macosx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@
#

- name: download DMG file
shell:
"curl -L -H 'Cookie:oraclelicense=accept-securebackup-cookie' -o {{ oracle_java_dir_source }}/{{ oracle_java_dmg_filename }} {{ oracle_java_dmg_url }}"
when: not oracle_java_task_dmg_check|skipped and not oracle_java_task_dmg_check.stat.exists
args:
creates: "{{ oracle_java_dir_source }}/{{ oracle_java_dmg_filename }}"
get_url:
headers:
Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F
oraclelicense: accept-securebackup-cookie
dest: "{{ oracle_java_dir_source }}/{{ oracle_java_dmg_filename }}"
url: "{{ oracle_java_dmg_url }}"
validate_certs: "{{ oracle_java_dmg_validate_certs }}"
timeout: "{{ oracle_java_download_timeout }}"
force: no
register: oracle_java_task_dmg_download
until: oracle_java_task_dmg_download is succeeded
tags:
- installation

Expand All @@ -36,4 +42,3 @@

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

28 changes: 16 additions & 12 deletions tasks/installation/redhat/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,42 @@

- name: download Java RPM
get_url:
headers='Cookie:gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie'
dest="{{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }}"
url="{{ oracle_java_rpm_url }}"
validate_certs="{{ oracle_java_rpm_validate_certs }}"
timeout={{ oracle_java_download_timeout }}
force=no
headers:
Cookie: "gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie"
dest: "{{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }}"
url: "{{ oracle_java_rpm_url }}"
validate_certs: "{{ oracle_java_rpm_validate_certs }}"
timeout: "{{ oracle_java_download_timeout }}"
force: no
register: oracle_java_task_rpm_download
until: oracle_java_task_rpm_download|succeeded
until: oracle_java_task_rpm_download is succeeded
become: yes
when: oracle_java_version_installed is not defined or oracle_java_version_installed != oracle_java_version_string

- name: install RPM
yum:
name="{{ oracle_java_dir_source }}/{{ oracle_java_rpm_filename }}"
state=present
when: not oracle_java_task_rpm_download|skipped
when: not oracle_java_task_rpm_download is skipped
become: yes

- name: set Java version as default
alternatives:
name="{{ item.exe }}"
link="/usr/bin/{{ item.exe }}"
path="{{ item.path }}/{{ item.exe }}"
name="{{ java.exe }}"
link="/usr/bin/{{ java.exe }}"
path="{{ java.path }}/{{ java.exe }}"
with_items:
- { path: "{{ oracle_java_home }}/bin", exe: 'java' }
- { path: "{{ oracle_java_home }}/bin", exe: 'keytool' }
- { path: "{{ oracle_java_home }}/bin", exe: 'javac' }
- { path: "{{ oracle_java_home }}/bin", exe: 'javadoc' }
loop_control:
loop_var: java
become: yes
when: (
oracle_java_set_as_default and
oracle_java_task_rpm_download is defined and
oracle_java_task_rpm_download|changed
oracle_java_task_rpm_download is changed
) or (
oracle_java_set_as_default and
oracle_java_installed is defined and
Expand Down