Option to force the set of the default jdk.

This commit is contained in:
Andrea Dell'Amico 2022-09-16 19:08:31 +02:00
parent 5131fe1868
commit 717c1b2350
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@
openjdk_install: True
openjdk_default: 8
jdk_default: '{{ openjdk_default }}'
openjdk_force_default: false
openjdk_pkg_state: present
openjdk_version:
- '{{ openjdk_default }}'

View File

@ -33,7 +33,7 @@
- name: Set the default OpenJDK as Zulu
shell: update-java-alternatives {{ openjdk_zulu_alternatives_options }} -s {{ openjdk_zulu_java_home }}
when: openjdk_installed is changed
when: openjdk_installed is changed or openjdk_force_default
- name: Set the correct value for jdk_java_home when we are installing Zulu
set_fact:
@ -69,7 +69,7 @@
- name: Set the default OpenJDK
shell: update-java-alternatives -s java-1.{{ openjdk_default }}.0-openjdk-amd64
when: openjdk_installed is changed
when: openjdk_installed is changed or openjdk_force_default
- name: Set the correct value for jdk_java_home when we are installing the distribution OpenJDK
set_fact: