Skip to content

java_version variable not used when installing an openjdk #12

Description

@captain-proton

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions