java: use default JRE when version is not specified

This commit is contained in:
Jérémy Lecour 2022-09-30 11:38:53 +02:00 committed by Jérémy Lecour
parent 6aeaab078d
commit 792d1170ab
3 changed files with 17 additions and 3 deletions

View file

@ -14,6 +14,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
### Changed
* java: use default JRE package when version is not specified
* lxc-solr: choose java package and download URL according to Solr Version
* lxc-solr: detect the real partition options
* lxc-solr: set homedir and port at install

View file

@ -1,4 +1,4 @@
---
java_alternative: 'openjdk'
java_version: 8
java_version: Null
java_default_alternative: True

View file

@ -13,7 +13,17 @@
tags:
- java
- name: Install openjdk package
- name: Install default openjdk package
apt:
name: "default-jre-headless"
default_release: "{{ java_apt_release }}"
state: present
tags:
- java
- packages
when: java_version is none
- name: Install specific openjdk package
apt:
name: "openjdk-{{ java_version}}-jre-headless"
default_release: "{{ java_apt_release }}"
@ -21,11 +31,14 @@
tags:
- java
- packages
when: java_version is not none
- name: This openjdk version is the default alternative
alternatives:
name: java
path: "{{ java_bin_path[java_version] }}"
when: java_default_alternative | bool
tags:
- java
when:
- java_default_alternative | bool
- java_version is not none