Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(FM-7921) - Implement Puppet Strings #353

Merged
merged 1 commit into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 1 addition & 88 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -95,94 +95,7 @@ java::oracle { 'jdk8' :

## Reference

### Classes

#### Public classes

* `java`: Installs and manages the Java package.

#### Private classes

* `java::config`: Configures the Java alternatives.

* `java::params`: Builds a hash of jdk/jre packages for all compatible operating systems.


#### Parameters

The following parameters are available in `java`:

##### `distribution`

Specifies the Java distribution to install.
Valid options: 'jdk', 'jre', or, where the platform supports alternative packages, 'sun-jdk', 'sun-jre', 'oracle-jdk', 'oracle-jre'. Default: 'jdk'.

##### `java_alternative`

Specifies the name of the Java alternative to use. If you set this parameter, *you must also set the `java_alternative_path`.*
Valid options: Run command `update-java-alternatives -l` for a list of available choices. Default: OS and distribution dependent defaults on *deb systems, undef on others.

##### `java_alternative_path`

*Required when `java_alternative` is specified.* Defines the path to the `java` command.
Valid option: String. Default: OS and distribution dependent defaults on *deb systems, undef on others.

##### `package`

Specifies the name of the Java package. This is configurable in case you want to install a non-standard Java package. If not set, the module installs the appropriate package for the `distribution` parameter and target platform. If you set `package`, the `distribution` parameter does nothing.
Valid option: String. Default: undef.

##### `version`

Sets the version of Java to install, if you want to ensure a particular version.
Valid options: 'present', 'installed', 'latest', or a string matching `/^[.+_0-9a-zA-Z:-]+$/`. Default: 'present'.

#### Public defined types

* `java::oracle`: Installs specified version of Oracle Java SE. You may install multiple versions of Oracle Jave SE on the same node using this defined type.

#### Parameters

The following parameters are available in `java::oracle`:

##### `version`
Version of Java Standard Edition (SE) to install. 6, 7 or 8.

##### `version_major`

Major version of the Java Standard Edition (SE) to install. Must be used together with `version_minor`. For example, '8u101'.

##### `version_minor`

Minor version (or build version) of the Java Standard Edition (SE) to install. Must be used together with `version_major`. For example, 'b13'.

##### `java_se`

Type of Java SE to install, jdk or jre.

##### `ensure`

Install or remove the package.

##### `oracle_url`

Official Oracle URL to download the binaries from.

##### `proxy_server`

Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive)

##### `proxy_type`

Proxy server type (none|http|https|ftp). (passed to archive)

##### `url`

Pass an entire URL to download the installer from rather than building the complete URL from other parameters. This will allow the module to be used even if the URLs are changed by Oracle. If this parameter is used, matching `version_major` and `version_minor` parameters must also be passed to the class.

##### `url_hash`

Directory hash used by the download.oracle.com site. This value is a 32 character string which is part of the file URL returned by the JDK download site.
For information on the classes and types, see the [REFERENCE.md](https://github.com/puppetlabs/puppetlabs-java/blob/master/REFERENCE.md). For information on the facts, see below.

### Facts

Expand Down
257 changes: 257 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
# Reference
<!-- DO NOT EDIT: This document was generated by Puppet Strings -->

## Table of Contents

**Classes**

_Public Classes_

* [`java`](#java): This module manages the Java runtime package

_Private Classes_

* `java::config`:
* `java::params`: This class builds a hash of JDK/JRE packages and (for Debian)
alternatives. For wheezy/precise, we provide Oracle JDK/JRE
options, even though those are not in the package repositories.

**Defined types**

* [`java::oracle`](#javaoracle): Installs Oracle Java. By using this module you agree to the Oracle licensing
agreement.

## Classes

### java

This module manages the Java runtime package

#### Parameters

The following parameters are available in the `java` class.

##### `distribution`

Data type: `String`

The java distribution to install. Can be one of "jdk" or "jre",
or other platform-specific options where there are multiple
implementations available (eg: OpenJDK vs Oracle JDK).

Default value: 'jdk'

##### `version`

Data type: `Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/]`

The version of java to install. By default, this module simply ensures
that java is present, and does not require a specific version.

Default value: 'present'

##### `package`

Data type: `Optional[String]`

The name of the java package. This is configurable in case a non-standard
java package is desired.

Default value: `undef`

##### `package_options`

Data type: `Optional[Array]`

Array of strings to pass installation options to the 'package' Puppet resource.
Options available depend on the 'package' provider for the target OS.

Default value: `undef`

##### `java_alternative`

Data type: `Optional[String]`

The name of the java alternative to use on Debian systems.
"update-java-alternatives -l" will show which choices are available.
If you specify a particular package, you will almost always also
want to specify which java_alternative to choose. If you set
this, you also need to set the path below.

Default value: `undef`

##### `java_alternative_path`

Data type: `Optional[String]`

The path to the "java" command on Debian systems. Since the
alternatives system makes it difficult to verify which
alternative is actually enabled, this is required to ensure the
correct JVM is enabled.

Default value: `undef`

##### `java_home`

Data type: `Optional[String]`

The path to where the JRE is installed. This will be set as an
environment variable.

Default value: `undef`

## Defined types

### java::oracle

Defined Type java::oracle

Install one or more versions of Oracle Java.

Uses the following to download the package and automatically accept
the licensing terms:
```
wget --no-cookies --no-check-certificate --header \
"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
"http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz"
```

#### Parameters

The following parameters are available in the `java::oracle` defined type.

##### `ensure`

Data type: `Any`

Install or remove the package.

Default value: 'present'

##### `version`

Data type: `Any`

Version of Java to install, e.g. '7' or '8'. Default values for major and minor versions will be used.

Default value: '8'

##### `version_major`

Data type: `Any`

Major version which should be installed, e.g. '8u101'. Must be used together with version_minor.

Default value: `undef`

##### `version_minor`

Data type: `Any`

Minor version which should be installed, e.g. 'b12'. Must be used together with version_major.

Default value: `undef`

##### `java_se`

Data type: `Any`

Type of Java Standard Edition to install, jdk or jre.

Default value: 'jdk'

##### `oracle_url`

Data type: `Any`

Official Oracle URL to download binaries from.

Default value: 'http://download.oracle.com/otn-pub/java/jdk/'

##### `proxy_server`

Data type: `Any`

Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive)

Default value: `undef`

##### `proxy_type`

Data type: `Any`

Proxy server type (none|http|https|ftp). (passed to archive)

Default value: `undef`

##### `url`

Data type: `Any`

Full URL, including oracle_url, release_major, release_minor and package_name, to
download the Oracle java_se installer. Originally present but not used, activated
to workaround MODULES-5058.

Default value: `undef`

##### `url_hash`

Data type: `Any`

Directory hash used by the download.oracle.com site. This value is a 32 character string
which is part of the file URL returned by the JDK download site.

Default value: `undef`

##### `jce`

Data type: `Any`

Install Oracles Java Cryptographic Extensions into the JRE or JDK

Default value: `false`

##### `basedir`

Data type: `Any`

Directory under which the installation will occur. If not set, defaults to
/usr/lib/jvm for Debian and /usr/java for RedHat.

Default value: `undef`

##### `manage_basedir`

Data type: `Any`

Whether to manage the basedir directory. Defaults to false.
Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter.

Default value: `false`

##### `package_type`

Data type: `Any`

Type of installation package for specified version of java_se. java_se 6 comes
in a few installation package flavors and we need to account for them.
Optional forced package types: rpm, rpmbin, tar.gz

Default value: `undef`

##### `manage_symlink`

Data type: `Any`

Whether to manage a symlink that points to the installation directory. Defaults to false.

Default value: `false`

##### `symlink_name`

Data type: `Any`

The name for the optional symlink in the installation directory.

Default value: `undef`

2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# On Debian systems, if alternatives are set, manually assign them.
# @api private
class java::config ( ) {
case $::osfamily {
'Debian': {
Expand Down
Loading