Forge Home

java

The Java module installs Oracle JDK or JRE on your node.

10,420 downloads

9,506 latest version

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

  • 1.0.2 (latest)
  • 1.0.1
  • 1.0.0
released Mar 6th 2015
This version is compatible with:
  • , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'oscerd-java', '1.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install oscerd-java --version 1.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
Tags: java, jdk, jre, oracle

Documentation

oscerd/java — version 1.0.2 Mar 6th 2015

Puppet Java Module

Introduction

This module install JDK or JRE with puppet

Installation

Clone this repository in a java directory in your puppet module directory

    git clone https://github.com/oscerd/puppet-java-module java

Usage

If you include the java::setup class the module will take the package from /java/files folder, extract his content and move it in a specific directory (based on the OS we are working on). Here is an example:

    java::setup { "java":
      type => "jdk",
      family => "7",
      update_version => "65",
      architecture => "x64",
      os => "linux",
      extension => ".tar.gz",
      tmpdir => "",
      alternatives => "",
      export => ""
      }

It's important to define a global search path for the exec resource to make module work. This should usually be placed in manifests/site.pp. It is also important to make sure unzip and tar command are installed on the target system:

    Exec {
      path => "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    }

    package { 'tar':
      ensure => installed
    }

    package { 'unzip':
      ensure => installed
    }

Parameters

The Puppet Java module use the following parameters in his setup

  • Type: Possible values of family are jdk or jre
  • Family: Possible values of Java version 6, 7, 8
  • Update Version: The update version
  • Architecture: The architecture related to the package. Possible values of architecture are i586, x64, sparc, sparcv9 (the last two need to be tested)
  • Operating System: The operating system related to the package, at this moment we support linux only
  • Extension: The file extension, at this moment is .tar.gz
  • Install Directory: The directory where the Apache Tomcat will be installed (default is /opt/)
  • Temp Directory: The directory where the java package will be extracted (default is /tmp/)
  • Alternatives: Possible values are yes, no and undef (default is no). If alternatives have value yes, then the module will make update alternatives to set the correct path to java, javac and javaws (in case of type jdk) or only java (in case of jre)
  • Export: Possible values are yes, no and undef (default is no). If export is set on yes, then module will export new JAVA_HOME environment variable.

Testing

The Puppet java module has been tested on the following Operating Systems:

  1. CentOS 6.5 x64
  2. Debian 7.5 x64
  3. Fedora 20.0 x86_64
  4. Ubuntu 14.04 x64

Contributing

Feel free to contribute by testing, opening issues and adding/changing code

Puppet Forge

The Puppet Java Module has been published on Puppet Forge: https://forge.puppetlabs.com/oscerd/java

License

Copyright 2014 Oscerd and contributors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.