Skip to content

Commit 8abe137

Browse files
author
David Swan
committed
(FM-7921) - Implement Puppet Strings
1 parent b998142 commit 8abe137

File tree

6 files changed

+319
-203
lines changed

6 files changed

+319
-203
lines changed

README.markdown

Lines changed: 1 addition & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -95,94 +95,7 @@ java::oracle { 'jdk8' :
9595

9696
## Reference
9797

98-
### Classes
99-
100-
#### Public classes
101-
102-
* `java`: Installs and manages the Java package.
103-
104-
#### Private classes
105-
106-
* `java::config`: Configures the Java alternatives.
107-
108-
* `java::params`: Builds a hash of jdk/jre packages for all compatible operating systems.
109-
110-
111-
#### Parameters
112-
113-
The following parameters are available in `java`:
114-
115-
##### `distribution`
116-
117-
Specifies the Java distribution to install.
118-
Valid options: 'jdk', 'jre', or, where the platform supports alternative packages, 'sun-jdk', 'sun-jre', 'oracle-jdk', 'oracle-jre'. Default: 'jdk'.
119-
120-
##### `java_alternative`
121-
122-
Specifies the name of the Java alternative to use. If you set this parameter, *you must also set the `java_alternative_path`.*
123-
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.
124-
125-
##### `java_alternative_path`
126-
127-
*Required when `java_alternative` is specified.* Defines the path to the `java` command.
128-
Valid option: String. Default: OS and distribution dependent defaults on *deb systems, undef on others.
129-
130-
##### `package`
131-
132-
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.
133-
Valid option: String. Default: undef.
134-
135-
##### `version`
136-
137-
Sets the version of Java to install, if you want to ensure a particular version.
138-
Valid options: 'present', 'installed', 'latest', or a string matching `/^[.+_0-9a-zA-Z:-]+$/`. Default: 'present'.
139-
140-
#### Public defined types
141-
142-
* `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.
143-
144-
#### Parameters
145-
146-
The following parameters are available in `java::oracle`:
147-
148-
##### `version`
149-
Version of Java Standard Edition (SE) to install. 6, 7 or 8.
150-
151-
##### `version_major`
152-
153-
Major version of the Java Standard Edition (SE) to install. Must be used together with `version_minor`. For example, '8u101'.
154-
155-
##### `version_minor`
156-
157-
Minor version (or build version) of the Java Standard Edition (SE) to install. Must be used together with `version_major`. For example, 'b13'.
158-
159-
##### `java_se`
160-
161-
Type of Java SE to install, jdk or jre.
162-
163-
##### `ensure`
164-
165-
Install or remove the package.
166-
167-
##### `oracle_url`
168-
169-
Official Oracle URL to download the binaries from.
170-
171-
##### `proxy_server`
172-
173-
Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive)
174-
175-
##### `proxy_type`
176-
177-
Proxy server type (none|http|https|ftp). (passed to archive)
178-
179-
##### `url`
180-
181-
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.
182-
183-
##### `url_hash`
184-
185-
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.
98+
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.
18699

187100
### Facts
188101

REFERENCE.md

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
# Reference
2+
<!-- DO NOT EDIT: This document was generated by Puppet Strings -->
3+
4+
## Table of Contents
5+
6+
**Classes**
7+
8+
_Public Classes_
9+
10+
* [`java`](#java): This module manages the Java runtime package
11+
12+
_Private Classes_
13+
14+
* `java::config`:
15+
* `java::params`: This class builds a hash of JDK/JRE packages and (for Debian)
16+
alternatives. For wheezy/precise, we provide Oracle JDK/JRE
17+
options, even though those are not in the package repositories.
18+
19+
**Defined types**
20+
21+
* [`java::oracle`](#javaoracle): Installs Oracle Java. By using this module you agree to the Oracle licensing
22+
agreement.
23+
24+
## Classes
25+
26+
### java
27+
28+
This module manages the Java runtime package
29+
30+
#### Parameters
31+
32+
The following parameters are available in the `java` class.
33+
34+
##### `distribution`
35+
36+
Data type: `String`
37+
38+
The java distribution to install. Can be one of "jdk" or "jre",
39+
or other platform-specific options where there are multiple
40+
implementations available (eg: OpenJDK vs Oracle JDK).
41+
42+
Default value: 'jdk'
43+
44+
##### `version`
45+
46+
Data type: `Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/]`
47+
48+
The version of java to install. By default, this module simply ensures
49+
that java is present, and does not require a specific version.
50+
51+
Default value: 'present'
52+
53+
##### `package`
54+
55+
Data type: `Optional[String]`
56+
57+
The name of the java package. This is configurable in case a non-standard
58+
java package is desired.
59+
60+
Default value: `undef`
61+
62+
##### `package_options`
63+
64+
Data type: `Optional[Array]`
65+
66+
Array of strings to pass installation options to the 'package' Puppet resource.
67+
Options available depend on the 'package' provider for the target OS.
68+
69+
Default value: `undef`
70+
71+
##### `java_alternative`
72+
73+
Data type: `Optional[String]`
74+
75+
The name of the java alternative to use on Debian systems.
76+
"update-java-alternatives -l" will show which choices are available.
77+
If you specify a particular package, you will almost always also
78+
want to specify which java_alternative to choose. If you set
79+
this, you also need to set the path below.
80+
81+
Default value: `undef`
82+
83+
##### `java_alternative_path`
84+
85+
Data type: `Optional[String]`
86+
87+
The path to the "java" command on Debian systems. Since the
88+
alternatives system makes it difficult to verify which
89+
alternative is actually enabled, this is required to ensure the
90+
correct JVM is enabled.
91+
92+
Default value: `undef`
93+
94+
##### `java_home`
95+
96+
Data type: `Optional[String]`
97+
98+
The path to where the JRE is installed. This will be set as an
99+
environment variable.
100+
101+
Default value: `undef`
102+
103+
## Defined types
104+
105+
### java::oracle
106+
107+
Defined Type java::oracle
108+
109+
Install one or more versions of Oracle Java.
110+
111+
Uses the following to download the package and automatically accept
112+
the licensing terms:
113+
```
114+
wget --no-cookies --no-check-certificate --header \
115+
"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
116+
"http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz"
117+
```
118+
119+
#### Parameters
120+
121+
The following parameters are available in the `java::oracle` defined type.
122+
123+
##### `ensure`
124+
125+
Data type: `Any`
126+
127+
Install or remove the package.
128+
129+
Default value: 'present'
130+
131+
##### `version`
132+
133+
Data type: `Any`
134+
135+
Version of Java to install, e.g. '7' or '8'. Default values for major and minor versions will be used.
136+
137+
Default value: '8'
138+
139+
##### `version_major`
140+
141+
Data type: `Any`
142+
143+
Major version which should be installed, e.g. '8u101'. Must be used together with version_minor.
144+
145+
Default value: `undef`
146+
147+
##### `version_minor`
148+
149+
Data type: `Any`
150+
151+
Minor version which should be installed, e.g. 'b12'. Must be used together with version_major.
152+
153+
Default value: `undef`
154+
155+
##### `java_se`
156+
157+
Data type: `Any`
158+
159+
Type of Java Standard Edition to install, jdk or jre.
160+
161+
Default value: 'jdk'
162+
163+
##### `oracle_url`
164+
165+
Data type: `Any`
166+
167+
Official Oracle URL to download binaries from.
168+
169+
Default value: 'http://download.oracle.com/otn-pub/java/jdk/'
170+
171+
##### `proxy_server`
172+
173+
Data type: `Any`
174+
175+
Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive)
176+
177+
Default value: `undef`
178+
179+
##### `proxy_type`
180+
181+
Data type: `Any`
182+
183+
Proxy server type (none|http|https|ftp). (passed to archive)
184+
185+
Default value: `undef`
186+
187+
##### `url`
188+
189+
Data type: `Any`
190+
191+
Full URL, including oracle_url, release_major, release_minor and package_name, to
192+
download the Oracle java_se installer. Originally present but not used, activated
193+
to workaround MODULES-5058.
194+
195+
Default value: `undef`
196+
197+
##### `url_hash`
198+
199+
Data type: `Any`
200+
201+
Directory hash used by the download.oracle.com site. This value is a 32 character string
202+
which is part of the file URL returned by the JDK download site.
203+
204+
Default value: `undef`
205+
206+
##### `jce`
207+
208+
Data type: `Any`
209+
210+
Install Oracles Java Cryptographic Extensions into the JRE or JDK
211+
212+
Default value: `false`
213+
214+
##### `basedir`
215+
216+
Data type: `Any`
217+
218+
Directory under which the installation will occur. If not set, defaults to
219+
/usr/lib/jvm for Debian and /usr/java for RedHat.
220+
221+
Default value: `undef`
222+
223+
##### `manage_basedir`
224+
225+
Data type: `Any`
226+
227+
Whether to manage the basedir directory. Defaults to false.
228+
Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter.
229+
230+
Default value: `false`
231+
232+
##### `package_type`
233+
234+
Data type: `Any`
235+
236+
Type of installation package for specified version of java_se. java_se 6 comes
237+
in a few installation package flavors and we need to account for them.
238+
Optional forced package types: rpm, rpmbin, tar.gz
239+
240+
Default value: `undef`
241+
242+
##### `manage_symlink`
243+
244+
Data type: `Any`
245+
246+
Whether to manage a symlink that points to the installation directory. Defaults to false.
247+
248+
Default value: `false`
249+
250+
##### `symlink_name`
251+
252+
Data type: `Any`
253+
254+
The name for the optional symlink in the installation directory.
255+
256+
Default value: `undef`
257+

manifests/config.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# On Debian systems, if alternatives are set, manually assign them.
1+
# @api private
22
class java::config ( ) {
33
case $::osfamily {
44
'Debian': {

0 commit comments

Comments
 (0)