Skip to content

Commit dd8b81a

Browse files
authored
ansible: fix existing Java detection edge case (#4295)
Add additional check for whether an existing `java` ran successfully as the original check could erroneously match if the Java version being checked for was in an error message (e.g. part of the directory name included in the message).
1 parent 960796d commit dd8b81a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ansible/roles/java-base/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
# If we're already using the latest there is no need to do anything.
5151
- name: check existing adoptopenjdk version is up to date
5252
set_fact:
53-
update_adoptopenjdk: "{{ adoptopenjdk_metadata.json[0].version_data.openjdk_version not in java.stdout }}"
53+
update_adoptopenjdk: "{{ java.rc != 0 or adoptopenjdk_metadata.json[0].version_data.openjdk_version not in java.stdout }}"
5454
when: use_adoptopenjdk == True
5555

5656
- name: create cache directory for adoptopenjdk binaries

0 commit comments

Comments
 (0)