T2L.java
Ansible Role: Java
This role installs Java on Ubuntu LTS using:
What makes this Java role special?
- You don’t need to know the exact package names. Just follow the instructions below.
- You can install both OpenJDK and Oracle Java at the same time (if you want).
- It works only with Ubuntu versions 14.04, 16.04, 18.04, and 20.04.
- It has been tested with Molecule 3.
Requirements
None.
Role Variables
Here are the available variables, along with example values (see defaults/main.yml):
You can specify which OpenJDK versions and types you want to install. OpenJDK currently supports versions 6-17. Not every version works with every Ubuntu. Check the PPA page for details. You can install either JRE or JDK:
java_openjdk_packages:
- version: 11
type: jre
For Oracle Java, you can only install JDK 16. You cannot choose the package type; just the version:
java_oracle_packages: []
Example (remember to remove the square brackets):
java_oracle_packages:
- version: 16
Default Java settings that also affect the JAVA_HOME environment variable. Options include:
- provider: The type of Java to use (
oracle
oropenjdk
). - version: The default Java version (6-17 for OpenJDK, but not all versions are compatible with every Ubuntu release, and 16 for Oracle Java).
java_default_alternative:
provider: openjdk
version: 11
Dependencies
None.
Example Playbook
- hosts: all
roles:
- T2L.java
License
MIT
Author Information
This role was created by Roman Paska in 2017-2021.
Changelog
The changelog is available here.
Installa
ansible-galaxy install T2L.java
Licenza
mit
Download
8.9k
Proprietario