Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 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 >= 3.4.0
- , , , , , , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'aco-oracle_java', '2.9.4'
Learn more about managing modules with a PuppetfileDocumentation
oracle_java
By using this module you acknowledge that you have read and accepted the terms of the Oracle Binary Code License Agreement for Java SE.
Downloads from the Oracle Java Archive require an Oracle.com account.
Table of Contents
- Overview - What is the oracle_java module?
- Module Description - What does the module do?
- Setup - The basics of getting started with tomcat
- Usage - The classes and defined types available for configuration
Overview
The oracle_java module allows you to install the Oracle JRE or JDK of your choice from the official archives provided by Oracle.
Module description
This module downloads the desired Java version from Oracle's website and installs it on the target system. On RPM-based distributions the RPM version will be used by default. On all other platforms a tar.gz archive will be retrieved and extracted. Multiple versions of Oracle Java can be installed on the same system using a defined type.
Java SE archives are available from the Oracle Java SE Downloads and Oracle Java Archive pages.
This module is suitable for pretty much any Linux system. It currently supports all released Java SE versions from JSE 7 on.
Setup
oracle_java will affect the following parts of your system:
- jre/jdk packages and/or archives
- java alternatives (and slaves)
Including the main class is enough to install the latest version of the Oracle JRE.
include oracle_java
A couple of examples
Install a specific version of the JDK
class { 'oracle_java':
version => '7u45',
type => 'jdk',
ssousername => 'me@example.com', # only for packages from the Oracle Java Archive
ssopassword => 'mypassword' #
}
Install multiple Java versions
class { 'oracle_java':
version => '8u45',
type => 'jdk'
}
oracle_java::installation { '7u65':
type => 'jdk'
}
Force installation from standard tar.gz archive, in a custom location
class { 'oracle_java':
…
format => 'tar.gz',
install_path => '/opt/java'
}
Disable checksum validation and add java alternative
class { 'oracle_java':
…
check_checksum => false,
add_alternative => true
}
Install a Java version not (yet) supported by this module
class { 'oracle_java':
…
version => '8u122',
build => '-b04',
checksum => '436fc6772eb961b07b7b3414ab111857',
urlcode => '/e9e7ea248e2c4826b92b3f075a80e441'
}
Install from custom archive and URL
class { 'oracle_java':
…
download_url => 'http://myrepo.com',
filename => 'my-jdk-8u66.tar.gz',
checksum => '380e6d224f5c8c8eba37c97439f09eb4'
}
Download Java archives behind a proxy server
class { 'oracle_java':
…
proxy_server => 'http://user:password@proxy.example.com:8080'
}
Usage
Classes and Defined Types
Class: oracle_java
Primary class and entry point of the module. Installs Java in /usr/java
Parameters within oracle_java
:
version
Java version to install, formatted as 'major_version'u'minor_version' or simply 'major_version' for the latest available release in the selected Java SE series. Defaults to 8
Note: a minor version of '0' (for example 8u0
) matches the initial release of the selected Java SE series.
format
What format of installation archive to retrieve. Valid values are rpm
and tar.gz
. Default depends on the platform.
ssousername
Oracle account username. Used to authenticate against Oracle.com Single Sign-on service and download packages from the Oracle Java Archive.
ssopassword
Oracle account password.
install_path
Absolute root path where the Oracle Java archives are extracted. Requires format
set to tar.gz
. Defaults to /usr/java
.
add_system_env
Add JAVA_HOME
environment variable to the /etc/environment
file. Boolean value. Defaults to false
.
See also Common parameters
Define: oracle_java::installation
Installs an extra version of Oracle Java in install_path
.
Parameters within oracle_java::installation
:
version
Namevar. See oracle_java::version
See also Common parameters
Common parameters
Parameters common to both oracle_java
and oracle_java::installation
.
build
Build number associated to the requested Java SE version, formatted as -b##
. Default determined automatically.
Note: this parameter is mandatory when installing a Java SE release which is not currently supported by this module.
type
What envionment type to install. Valid values are jre
and jdk
. Defaults to jre
.
check_checksum
Enable checksum validation on downloaded archives. Boolean value. Defaults to true
.
checksum
MD5 checksum used to verify the archive integrity. Defaults to the checksum provided by Oracle.
add_alternative
Add Oracle Java to the system alternatives on compatible platforms (Debian/RHEL/SuSE families). Boolean value. Defaults to false
.
download_url
Base URL of an alternative location to download the Java archive from. Defaults to Oracle servers.
filename
File name of the installation package to retrieve at ${download_url}
. Defaults to the file name provided by Oracle.
proxy_server
URL of a proxy server used for downloading Java archives.
proxy_type
Type of the proxy server. Valid values are none
, http
, https
and ftp
. Default determined by the scheme used in proxy_server
.
urlcode
Complex code Oracle adds to the download URL since Java SE 8u121. Default determined automatically.
Limitations
Prior to Java 8u20, two different releases of the same Java series could not cohabit on the same system when installed from RPM. Each new version would override the previous one. This does not happen with tar.gz archives.
Contributors
Credits
The cookie manipulation used by this module to download installation packages directly from Oracle's page was found on Ivan Dyedov's Blog
Features request and contributions are always welcome!
2.9.4
Add support for Java '8u171/8u172' (mtron)
2.9.3
- Add support for Java 9.0.4
- Fix "package is already installed" errors on RPM-based Linux distributions
2.9.2
- Add support for Java '8u161/8u162' (mtron)
- Fix Oracle SSO in client/server setups
2.9.1
- Add support for Java '8u151/8u152'
- Add support for Java 9.0.1
2.9.0
- Add Oracle.com Single Sign-on authentication
- re-enables downloads from the Oracle Java Archive
- new parameters
ssousername
,ssopassword
2.8.3
- Add support for Java '8u144' (mtron)
- Add support for Java 9
2.8.2
- Add support for Java '8u141' (mtron)
- Tested on Debian 9, Ubuntu 17.10 and Mageia 6
2.8.1
- Add support for Java '8u131'
- Tested on Ubuntu 17.04 and SuSE 12 SP2
2.8.0
- Add support for Java '8u121'
- Ease the installation of new Java SE releases using optional parameters (without updating the module)
build
urlcode
- Warning the following parameters were replaced:
custom_download_url
: renamed todownload_url
and complemented by a newfilename
parametercustom_checksum
: renamed tochecksum
2.7.4
- Add proxy support via new parameters
proxy_server
andproxy_type
- Replace or remove calls to deprecated
validate_*
stdlib functions
2.7.3
- Unset
provider
parameter on allarchive
resources (frompuppet-archive
module)- quick and dirty workaround until SERVER-94 gets fixed
- Warning: may break behind a HTTP proxy (untested)
- Tested on Fedora 25, Amazon Linux 2016.09
2.7.2
- Add support for Java '8u111'/'8u112' (mtron)
- Contain included classes (claytononeill)
- Tested on Ubuntu 16.10
2.7.1
Support Java 6 as extra installation
2.7.0
- Add support for Java '8u101'/'8u102'
- Restore support for Java '6u45' (main installation only)
- Tested on Fedora 24, OpenSUSE 42.1/42.2, Mageia 5
2.6.3
Add support for Java '8u91'/'8u92'
2.6.2
Add support for Java '8u77'
2.6.1
Add support for Java '8u71'/'8u72'
2.6.0
- Replace deprecated module dependency nanliu-archive with puppet-archive
- Use curl as download provider instead of faraday
2.5.1
Fix regression that forced format
to be set manually on non-RPM OS
2.5.0
New parameters (angrox):
install_path
: set Java installation pathcustom_download_url
: download the Java package/archive from a custom URLcustom_checksum
: custom MD5 checksum for package/archive integrity verification
2.4.2
Add support for Java '8u65'/'8u66'
2.4.1
Add support for Java '8u60'
2.4.0
- New parameter
add_system_env
to setJAVA_HOME
as system-wide environment variable - Fix dependency issue when installing multiple Java alternatives
- Merge missing changes to
installation
defined type
2.3.0
Support multiple installations of Oracle Java with a new defined type: oracle_java::installation
2.2.7
Add support for Java '8u51'
2.2.6
Fix conflict introduced by nanliu-archive v0.3.0
2.2.4
- Add support for Java '7u79', '7u80' and '8u45'
- Minor Puppet 4.0 compatibility fix
2.2.3
Add support for Java '8u40'
2.2.2
Add support for Java '7u75', '7u76' and '8u31'
2.2.1
Improve code quality, doc and metadata
2.2.0
- Support adding Oracle Java as a java alternative
- New
add_alternative
parameter - List of checksums now complete
2.1.0
- Added checksum check on downloaded archive
- New
check_checksum
parameter - Refactoring
- Better support of Mageia Linux
2.0.0
- Support tar.gz format - now multiplatform!
- Dropped support for Java 6
- Major refactoring
- Use
nanliu/archive
module for download and extraction
1.1.5
Add support for Java '7u71', '7u72' and '8u25'
1.1.4
- Fix bug in package name for Java 8u20
- Renamed exec resources to something less generic (avoid conflicts)
1.1.3
Add support for Java '8u20'
1.1.2
- Add support for Java '7u67'
- Make Puppet Doc compliant with RDoc markup language
1.1.1
- Add parameters validation
- Updated documentation
- Minor refactoring
1.1.0
Add support for Java SE 6 series
1.0.1
Add support for Java '7u65' and '8u11'
1.0.0
First forge release
Dependencies
- puppetlabs/stdlib (>= 3.2.0 < 5.0.0)
- puppet/archive (>= 0.4.4 < 3.0.0)
Copyright 2014 Antoine Cotten 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.