diff --git a/tasks/install.yml b/tasks/install.yml index 3b9b209..daa3066 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -20,7 +20,7 @@ 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_architecture != "armv7l" - name: copy JCE zip from local copy: @@ -31,6 +31,9 @@ when: not java_download_from_oracle +- name: delegate to APT installation process + include: use-apt.yml + when: ansible_pkg_mgr == "apt" and ansible_architecture == "armv7l" - name: delegate to RPM installation process include: use-rpm.yml @@ -38,7 +41,7 @@ - name: delegate to raw tarball installation process include: use-tarball.yml - when: ansible_pkg_mgr != "yum" and ansible_pkg_mgr != "zypper" and ansible_os_family != 'Darwin' + when: ansible_pkg_mgr != "yum" and ansible_pkg_mgr != "zypper" and ansible_os_family != 'Darwin' and ansible_architecture != "armv7l" - name: delegate to Mac OS X dmg installation include: use-dmg.yml @@ -66,7 +69,7 @@ - block: - # No link creation is necessary on Mac OS X -- + # No link creation is necessary on Mac OS X -- # the package installer automatically creates symlinks in /usr/bin. - name: link "{{ java_install_dir }}/{{ java_default_link_name }}" @@ -104,7 +107,7 @@ path: "{{ java_install_dir }}/{{ java_default_link_name }}" when: filecheck and filecheck.stat.exists - when: ansible_os_family != "Darwin" + when: ansible_os_family != "Darwin" and ansible_architecture != "armv7l" diff --git a/tasks/set-role-variables.yml b/tasks/set-role-variables.yml index 414de0a..87576b4 100644 --- a/tasks/set-role-variables.yml +++ b/tasks/set-role-variables.yml @@ -8,6 +8,18 @@ set_fact: jdk_version: "1.{{ java_version }}.0_{{ java_subversion }}" +# +# Specific preparation to support Raspbian (on ARM7) +# +- name: Select Java To Installation (Oracle Download) + set_fact: + java_download_from_oracle: true + when: ansible_architecture != "armv7l" + +- name: Select Java To Installation (Distribution Install) + set_fact: + java_download_from_oracle: false + when: ansible_architecture == "armv7l" and ansible_os_family == "Debian" and ansible_pkg_mgr == "apt" # # platform-specific variables diff --git a/tasks/use-apt.yml b/tasks/use-apt.yml new file mode 100644 index 0000000..2c04d17 --- /dev/null +++ b/tasks/use-apt.yml @@ -0,0 +1,16 @@ +--- +# file: use-apt.yml +# install Oracle JDK 1.x on Debian on ARM (e.G Raspian) +# + +- name: install Oracle JDK 8 from apt file {{java_version}} + become: yes + become_method: sudo + apt: name=oracle-java8-jdk + when: java_version == 8 + +- name: install Oracle JDK 7 from apt file + become: yes + become_method: sudo + apt: name=oracle-java7-jdk + when: java_version == 7