Skip to content

Commit

Permalink
Skip for MacOS, fix adopt roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Parker committed Feb 20, 2020
1 parent 7dddf15 commit 97da235
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 141 deletions.
4 changes: 3 additions & 1 deletion ansible/playbooks/AdoptOpenJDK_Unix_Playbook/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
- role: nasm # OpenJ9
when: ansible_architecture == 'x86_64'
tags: [build_tools, build_tools_openj9]
- adoptopenjdk8
- role: adoptopenjdk_install
jdk_version: 8
tags: build_tools
- role: adoptopenjdk_install # JDK11 Build Bootstrap
jdk_version: 10
tags: build_tools
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,27 @@
# Check if target is installed
# Proceed with installing to /usr/lib/jvm

- name: Set path variable when jdk_version == 8
set_fact:
path: /usr/lib/jvm/jdk8
when:
- jdk_version == 8
- ansible_os_family != "Darwin"
tags: adoptopenjdk_install

- name: Set path variable when jdk_version != 8
set_fact:
path: /usr/lib/jvm/jdk-{{ jdk_version }}
when:
- jdk_version != 8
- ansible_os_family != "Darwin"
tags: adoptopenjdk_install

- name: Checking for /usr/lib/jvm
stat: path=/usr/lib/jvm
register: usr_lib_jvm_exists
when:
- ansible_os_family != "Darwin"
tags: adoptopenjdk_install

- name: Creating /usr/lib/jvm if not found
Expand All @@ -18,13 +36,17 @@
state: directory
owner: root
mode: 0755
when: usr_lib_jvm_exists.stat.exists != True
when:
- usr_lib_jvm_exists.stat.exists != True
- ansible_os_family != "Darwin"
tags: adoptopenjdk_install

- name: Check if jdk-{{ jdk_version }} is already installed in the target location
shell: ls -ld /usr/lib/jvm/jdk-{{ jdk_version }}* >/dev/null 2>&1
shell: ls -ld {{ path }}* >/dev/null 2>&1
ignore_errors: yes
register: adoptopenjdk_installed
when:
- ansible_os_family != "Darwin"
tags:
- adoptopenjdk_install
- skip_ansible_lint
Expand All @@ -41,25 +63,12 @@
when:
- adoptopenjdk_installed.rc != 0
- ansible_architecture == "x86_64"
- ansible_os_family != "Darwin"
tags: adoptopenjdk_install

- name: Install latest release if one not already installed (Linux/s390x)
unarchive:
src: https://api.adoptopenjdk.net/v3/binary/latest/{{ jdk_version }}/ga/linux/s390x/jdk/{{ bootjdk }}/normal/adoptopenjdk?project=jdk
dest: /usr/lib/jvm
remote_src: yes
retries: 3
delay: 5
register: adoptopenjdk_download
until: adoptopenjdk_download is not failed
when:
- adoptopenjdk_installed.rc != 0
- ansible_architecture == "s390x"
tags: adoptopenjdk_install

- name: Install latest release if one not already installed (Linux/ppc64le)
- name: Install latest release if one not already installed (Linux/NOT x64)
unarchive:
src: https://api.adoptopenjdk.net/v3/binary/latest/{{ jdk_version }}/ga/linux/ppc64le/jdk/{{ bootjdk }}/normal/adoptopenjdk?project=jdk
src: https://api.adoptopenjdk.net/v3/binary/latest/{{ jdk_version }}/ga/linux/{{ ansible_architecture }}/jdk/{{ bootjdk }}/normal/adoptopenjdk?project=jdk
dest: /usr/lib/jvm
remote_src: yes
retries: 3
Expand All @@ -68,34 +77,25 @@
until: adoptopenjdk_download is not failed
when:
- adoptopenjdk_installed.rc != 0
- ansible_architecture == "ppc64le"
- ansible_architecture != "x86_64"
- ansible_os_family != "Darwin"
tags: adoptopenjdk_install

- name: Install latest Hotspot release if one not already installed (Linux/aarch64)
unarchive:
src: https://api.adoptopenjdk.net/v3/binary/latest/{{ jdk_version }}/ga/linux/aarch64/jdk/{{ bootjdk }}/normal/adoptopenjdk?project=jdk
dest: /usr/lib/jvm
remote_src: yes
retries: 3
delay: 5
register: adoptopenjdk_download
until: adoptopenjdk_download is not failed
when:
- adoptopenjdk_installed.rc != 0
- ansible_architecture == "aarch64"
tags: adoptopenjdk_install

- name: Get /usr/lib/jvm/jdk-{{ jdk_version }}* full path name
shell: ls -ld /usr/lib/jvm/jdk-{{ jdk_version }}* 2>/dev/null | awk '{print $9}'
- name: Get {{ path }}* full path name
shell: ls -ld {{ path }}* 2>/dev/null | awk '{print $9}'
register: adoptopenjdk_dir
when: adoptopenjdk_installed.rc != 0
when:
- adoptopenjdk_installed.rc != 0
- ansible_os_family != "Darwin"
tags: adoptopenjdk_install

- name: Chown /usr/lib/jvm/jdk-{{ jdk_version }}*
- name: Chown {{ path }}*
file:
path: '{{ adoptopenjdk_dir.stdout }}'
state: directory
owner: root
recurse: yes
when: adoptopenjdk_installed.rc != 0
when:
- adoptopenjdk_installed.rc != 0
- ansible_os_family != "Darwin"
tags: adoptopenjdk_install

0 comments on commit 97da235

Please sign in to comment.