Think the title says everything :). I had to set the variable java_default_version to install the appropriate version. If I'm correct the setting for the openjdk variable come from the file vars/main.yml
|
java_openjdk_package: "{{ _java_openjdk_package[java_type][java_default_version|int][ansible_distribution] | default(_java_openjdk_package[java_type][java_default_version|int]['default'] | default([] )) }}" |
Sample Playbook
---
- name: Get some delicious coffee
hosts: all
become: true
tasks:
- name: Bootstrap machine
include_role:
name: galaxy/robertdebock.bootstrap
- name: Java must be present
include_role:
name: galaxy/robertdebock.java
vars:
java_vendor: openjdk
java_type: jdk
java_version: "8"
Output
Taken from the target:
vagrant@ubuntu-focal:~$ java --version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
Environment
- Control node OS: Manjaro Linux
- Control node Ansible version: 2.11.1
- Managed node OS: Ubuntu 20.04.3
Think the title says everything :). I had to set the variable
java_default_versionto install the appropriate version. If I'm correct the setting for the openjdk variable come from the filevars/main.ymlansible-role-java/vars/main.yml
Line 102 in c1a376d
Sample Playbook
Output
Taken from the target:
vagrant@ubuntu-focal:~$ java --version openjdk 11.0.11 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)Environment