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

Install correct version of openjdk on Debian #76

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
molecule_distro:
#- centos7
- centos8
#- debian9
#- debian10
- debian9
- debian10
#- fedora
#- ubuntu1604
- ubuntu1804
Expand Down
16 changes: 14 additions & 2 deletions ansible-scylla-loader/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,29 @@
when: scylla_dependencies is defined and (scylla_dependencies|length > 0)
become: true

- name: Set Java facts for Debian 8 and 9
set_fact:
java_package_name: "openjdk-8-jre-headless"
java_path: "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java"
when: ansible_distribution_major_version|int < 10

- name: Set Java facts for Debian 10 and above
set_fact:
java_package_name: "openjdk-11-jre-headless"
java_path: "/usr/lib/jvm/java-11-openjdk-amd64/bin/java"
when: ansible_distribution_major_version|int > 9

- name: Install Java
apt:
name: openjdk-8-jre-headless
name: "{{ java_package_name }}"
state: present
force_apt_get: yes
become: true

- name: Correct java version selected
alternatives:
name: java
path: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
path: "{{ java_path }}"
become: true

- name: install scylla-tools-core|scylla-enterprise-tools-core
Expand Down
1 change: 1 addition & 0 deletions ansible-scylla-node/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ galaxy_info:
versions:
- 8
- 9
- 10
- name: Ubuntu
versions:
- 20.04
Expand Down
32 changes: 23 additions & 9 deletions ansible-scylla-node/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,30 @@
force_apt_get: yes
when: scylla_dependencies is defined and (scylla_dependencies|length > 0)

- name: Install Java
apt:
name: openjdk-8-jre-headless
state: present
force_apt_get: yes
- name: Set Java facts for Debian 8 and 9
set_fact:
java_package_name: "openjdk-8-jre-headless"
java_path: "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java"
when: ansible_distribution_major_version|int < 10

- name: Set Java facts for Debian 10 and above
set_fact:
java_package_name: "openjdk-11-jre-headless"
java_path: "/usr/lib/jvm/java-11-openjdk-amd64/bin/java"
when: ansible_distribution_major_version|int > 9

- name: Install Java
apt:
name: "{{ java_package_name }}"
state: present
force_apt_get: yes
become: true

- name: Correct java version selected
alternatives:
name: java
path: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
- name: Correct java version selected
alternatives:
name: java
path: "{{ java_path }}"
become: true

- name: Install latest OSS Scylla
apt:
Expand Down