Forge Home

java

Install Java OpenJDK and configure the default java alternative

17,921 downloads

5,012 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 2.0.2 (latest)
  • 2.0.1
  • 2.0.0
  • 1.2.1
  • 1.2.0
  • 1.1.2
  • 1.1.1 (deleted)
  • 1.1.0
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Jan 4th 2019
This version is compatible with:
  • Puppet Enterprise 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0
  • Ubuntu, Debian, RedHat, CentOS

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'dsestero-java', '2.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add dsestero-java
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install dsestero-java --version 2.0.2

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

dsestero/java — version 2.0.2 Jan 4th 2019

#java

####Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with java
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

##Overview

This is the java module. It allows to install Java OpenJDK or Oracle JDK and configure the default java alternative.

##Module Description

The module provides classes and defines to install Java OpenJDK from distribution packages or rather install Oracle JDK. Furthermore, it allows to configure the java alternative on Debian and RedHat family distributions. It allows to install multiple Java versions on the same node. It allows to install java 8 even if it is not in the standard repository in Ubuntu 12.04 and 14.04 via ppa.

##Setup

###What java affects

The module installs the OpenJDK package from the repositories or the Oracle JDK from the download archive.

If required, the module sets up the alternative system for the java command. This is specified by providing a hiera value for the parameter java::java_default_version; in that case, the alternative system link for the command java is set to manual mode according to specified version. Otherwise it is left as it is.

In case java 8 installation is required on Ubuntu 12.04 or Ubuntu 14.04 the repository ppa:openjdk-r/ppa is added.

The module provides a jce_policy_6 class to be used to override two libraries in the standard java distribution. Due to import control restrictions, the version of JCE policy files that are bundled in the JDK(TM) 6 environment allow "strong" but limited cryptography to be used. This override provides "unlimited strength" policy files which contain no restrictions on cryptographic strengths. Notice that at the moment this class supports only openjdk-6 on Debian/Ubuntu systems.

###Setup Requirements

The module requires the following modules:

  • puppetlabs/apt

    to manage apt repositories

  • dsestero/download_uncompress

    to provide the basic capability to download and unzip Oracle Java distributions

###Beginning with java

The module provides different classes to install Java OpenJDK 6, 7, 8 and 9; furthermore, it is possible to install Oracle JDK 7 and 8. This is done, for example, by declarations as the following:

include java_7

##Usage

It is possible to install multiple versions of Java on a single node and to specify via hiera the default java to be set in the alternative system. An example hiera (JSON) declaration for a node could be as follows:

{
  "classes" : [
    "java::java_6",
    "java::java_7"
    ],
  "java::java_default_version" : "6"
}

##Limitations

At the moment the module targets only OpenJDK 6, 7 and 8 on Debian, Ubuntu, RedHat and CentOS platforms. Specifically, it was tested on Ubuntu 12.04, 14.04, 16.04 and CentOS 6.6 distributions; although probably it will work also on different versions.

##Development

If you need some feature please send me a (pull) request and send me an email at: dsestero 'at' gmail 'dot' com.