-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add java role #59
Add java role #59
Conversation
@@ -0,0 +1 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this empty file is required otherwise molecule complains that the inventory doesn't exist
cmd: | | ||
set -o pipefail | ||
java -version 2>&1 | grep version | awk '{print $3}' | sed 's/"//g' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the output from java -version
is:
openjdk version "1.8.0_402"
OpenJDK Runtime Environment (build 1.8.0_402-b06)
OpenJDK 64-Bit Server VM (build 25.402-b06, mixed mode)
The output from the command on line 9 is:
1.8.0_402
- name: Check the java version is correct | ||
ansible.builtin.assert: | ||
that: | ||
- java_version.stdout | split("_") | first is version('1.8.0') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the _402
from 1.8.0_402
(as we only specify that 1.8.0 should be installed, not 1.8.0_402)
|
||
- name: Get info for java package directory | ||
ansible.builtin.stat: | ||
path: "/usr/lib/jvm/{{ java_package }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/usr/lib/jvm/{{ java_package }}
is a symlink. We need to use the full path to the target when selecting the version to use with alternatives
- name: Install latest version of Java | ||
ansible.builtin.package: | ||
name: java-21-openjdk-devel | ||
state: present |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install Java 21 here so that after running the role (which install Java 8) we can test whether Java 8 has been set as the default version instead of 21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install Java 11 instead of 21 as 21 doesn't seem to be available on CentOS 7
Co-authored-by: Daniel Matthews <[email protected]>
Adds a role to install java. The functionality is included in the
mirsg.infrastructure.tomcat
role but is needed as a standalone as a prerequisite to installing OMERO.