buluma.java
Ansible Role Java
This role helps you install and set up Java on your system.
GitHub | Version | Issues | Pull Requests | Downloads |
---|---|---|---|---|
Example Playbook
This example comes from molecule/default/converge.yml
and is tested with every push, pull request, and release.
---
- name: Converge
hosts: all
become: true
gather_facts: true
roles:
- role: buluma.java
# To install Oracle Java 21 package:
# NOTE: Please download Java yourself and place it in `files/`.
# This avoids licensing issues.
# java_source: local
# java_type: jdk
# java_format: deb
# java_version: 21
Before using this role, prepare the machine. In CI, this is done using molecule/default/prepare.yml
:
---
- name: Prepare
hosts: all
become: true
gather_facts: false
roles:
- role: buluma.bootstrap
You can find a full explanation and example on using these roles.
Role Variables
Default values for the variables can be found in defaults/main.yml
:
---
# defaults file for java
# Set the vendor of Java, options are "openjdk" or "oracle".
java_vendor: openjdk
# Choose the type for installation, options are "jre" or "jdk".
java_type: jre
# Set the version of Java, options are 6, 7, 8, 9, 10, 11, 12, 13, 17, 19, 20, or 21.
# By default, the distribution's default is used, as seen in `vars/main.yml`.
# Setting java_version will override this to your chosen version.
java_version: "{{ java_default_version }}"
# Specify the format for the installation source, options are "deb", "rpm", or "targz".
# Only relevant for "java_vendor == oracle"
java_format: targz
# Source for RPM installations when using Oracle RPMs?
# Options are "local" or "repository".
# Valid for "java_vendor == oracle" and "java_format" == "rpm"
java_source: local
# Decide if you want JCE installed. This is relevant for:
# - java_vendor == "oracle"
# - java_version == "8"
java_jce: true
# If using "java_vendor == oracle" and "java_format == targz", set the directory for installation.
java_install_directory: /opt
Requirements
- Required pip packages listed in requirements.txt.
State of Used Roles
The following roles are used to prepare the system. You can prepare your system in other ways.
Requirement | GitHub | Version |
---|---|---|
buluma.bootstrap |
Context
This role is part of other compatible roles. Check the documentation of these roles for more information.
Overview of related roles:
Compatibility
This role has been tested with these container images:
Container | Tags |
---|---|
Alpine | all |
Amazon | Candidate |
EL | 8, 9 |
Debian | all |
Fedora | all |
opensuse | all |
Ubuntu | focal, bionic, jammy, lunar |
Ansible version 2.12 or higher is required. Tests were conducted on:
- The prior version.
- The current version.
- The development version.
If you encounter any issues, please report them on GitHub.
Changelog
License
Author Information
Install and configure java on your system.
ansible-galaxy install buluma.java