tylerwalts / puppet-jdk_oracle

Puppet module to install JDK from oracle using wget
Other
15 stars 54 forks source link

puppet-jdk_oracle

Deprecated!

As of 2017-12-20 I've decided to no longer maintain this module, and recommend the official PuppetLabs module, here:

The folks at puppet have implemented the java::oracle class such that it can auto-accept the cookie and install from tarball, just like this one, and it is better maintained.

Thanks to everyone who has contributed and used this module over the years! At the time of writing, this module has picked up over 56K downloads and a 4.9 quality rating on the Puppet Forge.

Please reach out if you would like to take over maintenance on this module.

Cheers,


Build Status

Overview

Puppet module to automate fetching and installing the Oracle JDK/JRE/Server-JRE from the Oracle-hosted download site located here: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Note: By using this module you will automatically accept the Oracle agreement to download Java.

There are several puppet modules available that will help install Oracle JDK/JRE/Server-JRE, but they either use the local package manager repository, or depend on the user to manually place the Oracle Java installer in the module's file directory prior to using. This module will use wget with a cookie to automatically grab the installer from Oracle.

This approach was inspired by: http://stackoverflow.com/questions/10268583/how-to-automate-download-and-instalation-of-java-jdk-on-linux

Supported Operating Systems:

Supported Java Versions:

Reasons you may want to use this module:

  1. You do not control or trust your package repository to host the version of Oracle Java that you want.
  2. You want to lock in the version that gets installed.
  3. You want to use Oracle’s CDN to host the binary instead of hosting it yourself.

Reasons why you would not want to use this module:

  1. If you want to use package management (.deb, .rpm) instead of extracting a generic archive.
    1. Consider schrepfler’s fork which does RPM without v6: https://github.com/schrepfler/puppet-jdk_oracle
  2. If you want to rely on your package repository to host the binary, not Oracle.
  3. If your target configuration server does not have access to the Internet. Assumes the server can pull it.

Installation:

A) Traditional:

B) Puppet Librarian:

From Source:

mod "tylerwalts/jdk_oracle",
    :git => "git://github.com/tylerwalts/puppet-jdk_oracle.git"

Usage:

A) Traditional:

    include jdk_oracle

or

    class { 'jdk_oracle': }

B) Hiera:

config.json:

    {
        classes":[
          "jdk_oracle"
        ]
    }

OR config.yaml:

---
  classes:
    - "jdk_oracle"
  jdk_oracle::version: "6"

site.pp:

    hiera_include("classes", [])

Parameters:

Class jdk_oracle

jdk_oracle::install

Basicaly the same option as class jdk_oracle.

Example Usage.

to install the default jdk8u11 plus jdk8u102 as default with JCE with default parameters :

class { 'jdk_oracle':
  jce        => true
}

jdk_oracle::install { 'jdk_11u102':
  version_update => '102',
  version_build  => '14',
  default_java   => true,
  jce            => true,
  install_dir    => '/usr/java'
}

to install only jdk8u102 as default with jce, with custom repository and proxy

class { 'jdk_oracle':
  jce            => true,
  default        => true,
  download_url   => 'https://nexus.corp/java',
  proxy_host     => 'http://proxyhost:3128',
  version_update => '102',
  version_build  => '14',
}