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

ansible: install temurin JDK on macOS #3085

Merged
merged 5 commits into from
Nov 23, 2022
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
23 changes: 2 additions & 21 deletions ansible/roles/java-base/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,13 @@
# Package manager mapping in ansible/roles/package-upgrade/vars/main.yml.
use: "{{ os|match_key(pm)|default(omit) }}"

- name: install java tap (macOS)
become_user: administrator
when: java.rc > 0 and os|startswith("macos") and arch == "x64"
homebrew_tap:
name: AdoptOpenJDK/openjdk
state: present

- name: install java (macOS)
become_user: administrator
when: java.rc > 0 and os|startswith("macos") and arch == "x64"
become_user: "{{ ansible_user }}"
when: java.rc > 0 and os|startswith("macos")
homebrew_cask:
name: "{{ java_package_name }}"
state: present

- name: Fetch java (Apple Silicon)
when: java.rc > 0 and os|startswith("macos11") and arch == "arm64"
shell:
chdir: "/Users/{{ ansible_user }}"
cmd: "curl -L -o zulu8.52.0.23-ca-jdk8.0.282-macosx_aarch64.tar.gz https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-macosx_aarch64.tar.gz"

- name: Extract java (Apple Silicon)
when: java.rc > 0 and os|startswith("macos11") and arch == "arm64"
shell:
chdir: "/Users/{{ ansible_user }}"
cmd: "tar -xf zulu8.52.0.23-ca-jdk8.0.282-macosx_aarch64.tar.gz"

- name: install webupd8 oracle java 8 extras
when: java.rc > 0 and os == "ubuntu1404" and arch != "ppc64"
package: name="{{item}}" state=present
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/java-base/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ packages: {
'fedora': 'java-1.8.0-openjdk-headless',
'freebsd': 'openjdk8-jre',
'ibmi': 'openjdk-11-ea',
'macos': 'adoptopenjdk8',
'macos': 'temurin17',
'rhel7': 'java-11-openjdk',
'rhel8': 'java-17-openjdk',
'smartos': 'openjdk8',
Expand Down
3 changes: 1 addition & 2 deletions ansible/roles/jenkins-worker/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ java_path: {
'macos10.14': 'java',
'macos10.15': 'java',
'macos11': 'java',
# Currently hardcoded untill adopt have their build available
'macos11.0': '/Users/{{ ansible_user }}/zulu8.52.0.23-ca-jdk8.0.282-macosx_aarch64/bin/java',
'macos11.0': 'java',
'smartos15': '/opt/local/java/openjdk8/bin/java',
'smartos16': '/opt/local/java/openjdk8/bin/java',
'smartos17': '/opt/local/java/openjdk8/bin/java',
Expand Down
7 changes: 4 additions & 3 deletions ansible/roles/package-upgrade/tasks/partials/brew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
raw: xcode-select --print-path &> /dev/null
register: xcode
ignore_errors: yes
check_mode: no

- name: Install xcode-tools
script: files/install-xcode.sh
when: xcode.rc > 1

- name: Check if Homebrew is already installed (Apple Sillicon)
- name: Check if Homebrew is already installed (Apple Silicon)
stat:
path: /opt/homebrew/bin/brew
register: armbrew
Expand Down Expand Up @@ -45,10 +46,10 @@
homebrew_tap:
name: buo/cask-upgrade

- name: Add AdoptOpenJDK Java Repo
- name: Install brew cask-versions
targos marked this conversation as resolved.
Show resolved Hide resolved
become_user: "{{ ansible_user }}"
homebrew_tap:
name: AdoptOpenJDK/openjdk
name: homebrew/cask-versions

- name: Update Casks
become_user: "{{ ansible_user }}"
Expand Down