Forge Home

java

Puppet module to deploy Oracle's ( formerly Sun Microsystems ) JDK or JRE ( Java )

810,805 downloads

809,138 latest version

4.3 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.0.8 (latest)
  • 0.0.7
  • 0.0.6
  • 0.0.5 (deleted)
  • 0.0.4 (deleted)
  • 0.0.3 (deleted)
  • 0.0.2 (deleted)
  • 0.0.1 (deleted)
released Sep 23rd 2013

Start using this module

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

Add this module to your Puppetfile:

mod '7terminals-java', '0.0.8'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install 7terminals-java --version 0.0.8

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

7terminals/java — version 0.0.8 Sep 23rd 2013

java

Overview

The Java module installs the JDK and JRE.

Module Description

The Java module allows Puppet to install the JDK/JRE and update the bashrc file to include java in the path.

Setup

What java affects:

  • installation directory for java
  • bashrc file of the user or /etc/bashrc if parameter pathfile is not set

Beginning with Java

To deploy JDK-6u35-x64 to /home/example.com/apps/jdk-6u35 and append JAVA_HOME to $PATH

java::setup { "example.com-jdk_6u35":
  ensure        => 'present',
  source        => 'jdk-6u35-linux-x64.tar.gz',
  deploymentdir => '/home/example.com/apps/jdk-6u35',
  user          => 'example.com',
  pathfile      => '/home/example.com/.bashrc'
}

Example usage on OpenSuSE

To install globally in /usr/lib64/jvm/oracle-jdk7 with environment configured via /etc/profile.local:

java::setup {'jdk-7u21-linux-x64':
  source => 'jdk-7u21-linux-x64.tar.gz',
  deploymentdir => '/usr/lib64/jvm/oracle-jdk7',
  user => 'root',
  pathfile => '/etc/profile.local',
  cachedir => "/tmp/java-setup-${name}"
}

Usage

The java::setup resource definition has several parameters to assist installation of java.

Parameters within java

####ensure

This parameter specifies whether java should be deployed to the deployment directory and bashrc file is updated or not. Valid arguments are "present" or "absent". Default

####source

This parameter specifies the source for the java archive. This file must be in the files directory in the caller module. Value should be the exact name of the downloaded JDK or JRE archive file put in the files directory

Only .tar.gz, .gz or .bin format as provided on Oracle's download website are supported.

####deploymentdir

This parameter specifies the directory where java will be installed.

Note: If deploymentdir is set to /usr/local/, and you want to remove this installation in the future, setting ensure => 'absent' will cause the entire directory, i. e. /usr/local/ to be deleted permanently.

####user

This parameter is used to set the permissions for the installation directory of java.

####pathfile

This parameter is used to find and update the bashrc file to include java in the environment path.

Limitations

This module has been built and tested using Puppet 2.6.x, 2.7, and 3.x.

The module has been tested on:

  • CentOS 5.9
  • CentOS 6.4
  • Debian 6.0
  • Ubuntu 12.04
  • OpenSuSE 12.1 (x64)

Testing on other platforms has been light and cannot be guaranteed.

Development

Bug Reports

Release Notes

0.0.8 #10 - prepend JAVA_HOME to PATH instead of appending it #9 - improved module stability when default $cache_dir does not exist

0.0.7 #7 - license added according to module specs

0.0.6 #7 - added module license

0.0.5 #6 - native support from .bin format of JDK / JRE as provided in Oracle's download section

0.0.4 #5 - search term 'java' on forge.puppetlabs.com friendly

0.0.3 #2 - added support for $::osfamily = Suse

0.0.2 #1 - fixed validation error

0.0.1

First initial release.