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 >= 4.0.0
- Ubuntu, Debian, RedHat, CentOS
Start using this module
Add this module to your Puppetfile:
mod 'dsestero-java', '2.0.2'
Learn more about managing modules with a PuppetfileDocumentation
#java
####Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with java
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- 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.
Reference
Table of Contents
Classes
java::java_6
: This class installs Java-6.java::java_7
: This class installs Java-7.java::java_7_jdk
: This class installs Oracle Java-7.java::java_8
: This class installs Java-8.java::java_8_jdk
: This class installs Oracle Java-8.java::java_9
: This class installs Java-9.java::jce_policy_6
:java::jdkfolder
: Creates /opt/jdk folder used to contain Oracle jdk installation.
Defined types
java
: This module manages Java. Declares all other defines in the java module needed for installing Java. Currently, these consists of java::instajava::install_config
: Configures Java. It is intended to be called by java::java. == Actions: Sets up the default java according to the parameter java_defaul
Classes
java::java_6
This class installs Java-6.
Examples
Declaring in manifest
include java::java_6
Hiera data for using java_6
classes:
- java::java_6
java::java_7
This class installs Java-7.
Examples
Declaring in manifest
include java::java_7
Hiera data for using java_7
classes:
- java::java_7
java::java_7_jdk
This class installs Oracle Java-7.
Examples
Declaring in manifest
include java::java_7_jdk
Hiera data for using java_7_jdk
classes:
- java::java_7_jdk
java::java_8
This class installs Java-8.
Examples
Declaring in manifest
include java::java_8
Hiera data for using java_8
classes:
- java::java_8
java::java_8_jdk
This class installs Oracle Java-8.
Examples
Declaring in manifest
include java::java_8_jdk
Hiera data for using java_8_jdk
classes:
- java::java_8_jdk
java::java_9
This class installs Java-9.
Examples
Declaring in manifest
include java::java_9
Hiera data for using java_9
classes:
- java::java_9
java::jce_policy_6
The java::jce_policy_6 class.
java::jdkfolder
Creates /opt/jdk folder used to contain Oracle jdk installation.
Defined types
java
This module manages Java.
Declares all other defines in the java module needed for installing Java. Currently, these consists of java::install, and java::config. If hiera defines a value for the parameter java_default_version on the target node the command update-alternatives is issued to set the default java accordingly.
Examples
Declaring in manifest
java {'8': }
Parameters
The following parameters are available in the java
defined type.
java_version
Data type: String
the java version. Possible values at this time are 6, 7, 8 and 9.
Default value: $title
openjdk
Data type: Boolean
use openjdk. Defaults to true. true means to install openjdk from distribution packages false means to untar the Oracle archive.
Default value: true
java_default_version
Data type: Optional[String]
the java default version. Possible values at this time are 6, 7, 8 and 9. Oracle jdk-6, howewer, is not supported while Oracle jdk-7 and Oracle jdk-8 at the moment are 64 bit versions. If different than +undef+ it will be used to configure the alternative system.
Default value: lookup('java::java_default_version', Optional[String], 'first', undef)
java::install_config
Configures Java. It is intended to be called by java::java.
== Actions:
Sets up the default java according to the parameter java_default_version if it is not null.
Parameters
The following parameters are available in the java::install_config
defined type.
java_version
Data type: String
the java version. Possible values at this time are 6 and 7.
Default value: $title
openjdk
Data type: Boolean
use openjdk. true means to install openjdk from distribution packages false means to untar the Oracle archive.
java_default_version
Data type: Optional[String]
the java default version. Possible values at this time are 6, 7>/tt> and 8. Oracle jdk-6, howewer, is not supported while Oracle jdk-7 and Oracle jdk-8 at the moment are 64 bit versions. If different than +undef+ it will be used to configure the alternative system.
##2019-01-04 - Release - 2.0.2 ###Summary Fixed link to java home directory for openjdk on RHEL/CentOS 5 and 6.
##2018-08-28 - Release - 2.0.1 ###Summary Minor fixes to improve the quality score.
##2018-01-09 - Release - 2.0.0 ###Summary Facts revision to comply with modern Puppet 4/5 recommended style. Added documentation generated with puppet strings. Added compliance with pdk. Attention: the module is no more compatible with Puppet 3.
##2017-05-12 - Release - 1.2.1 ###Summary Fixed regression error on non Debian os family.
##2017-04-04 - Release - 1.2.0 ###Summary Added support for java 8 on Ubuntu 12.04 and 14.04 via ppa repository.
##2017-03-10 - Release - 1.1.2 ###Summary Fixed empty release.
##2016-11-11 - Release - 1.1.1 ###Summary Fixed regression in properly recognizing osfamily.
##2016-11-10 - Release - 1.1.0 ###Summary Added support for RedHat and CentOS distributions. Removed support fo Ubuntu 10.04. Removed restriction on specific Ubuntu versions. Added java_8.
##2015-07-12 - Release - 1.0.3 ###Summary Bump version number after testing with Puppet 4.
##2015-04-30 - Release - 1.0.2 ###Summary Improved documentation, rspec tests added, license changed from CC-BY-SA-4.0 to Apache-2.0.
##2015-04-22 - Release - 1.0.1 ###Summary Code polishing to be more compliant with puppet-lint suggestions.
##2015-04-21 - Release - 1.0.0 ###Summary Initial release as PuppetForge module.
####Features See the README.markdown
####Bugfixes
####Known bugs
- No known bugs
Dependencies
- puppetlabs/apt (2.x)
- dsestero/download_uncompress (1.x)
Copyright (C) 2015 Dario Sestero Dario Sestero can be contacted at: dsestero 'at' gmail 'dot' com 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.