diff --git a/README.md b/README.md index a665445..659baf7 100644 --- a/README.md +++ b/README.md @@ -123,9 +123,9 @@ Simple example: ``` -### (Optionally) pre-fetch .rpm and .tar.gz files +### (Optionally) pre-fetch .rpm, .tar.gz or .dmg files -For some reasons, you may want to pre-fetch .rpm and .tar.gz files *before the execution of this role*, instead of downloading from Oracle on-the-fly. +For some reasons, you may want to pre-fetch .rpm, .tar.gz or .dmg files *before the execution of this role*, instead of downloading from Oracle on-the-fly. To do this, put the file on the `{{ playbook_dir }}/files` directory in advance, and then set the `java_download_from_oracle` variable to `false`: diff --git a/tasks/install.yml b/tasks/install.yml index cfd0e40..a1aaf9e 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -20,7 +20,13 @@ copy: src: "{{ playbook_dir }}/files/{{ jdk_tarball_file }}.tar.gz" dest: "{{ java_download_path }}/{{ jdk_tarball_file }}.tar.gz" - when: ansible_pkg_mgr != "yum" and ansible_pkg_mgr != "zypper" + when: ansible_pkg_mgr != "yum" and ansible_pkg_mgr != "zypper" and ansible_os_family != "Darwin" + + - name: copy .dmg from local + copy: + src: "{{ playbook_dir }}/files/{{ jdk_tarball_file }}.dmg" + dest: "{{ java_download_path }}/{{ jdk_tarball_file }}.dmg" + when: ansible_pkg_mgr != "yum" and ansible_pkg_mgr != "zypper" and ansible_os_family == "Darwin" when: not java_download_from_oracle