You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+94-26Lines changed: 94 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,12 @@
1
1
Description
2
2
===========
3
3
4
-
Installs a Java. Uses OpenJDK by default but supports installation of the Sun's Java.
4
+
Installs a Java. Uses OpenJDK by default but supports installation of
5
+
the Oracle's JDK.
6
+
7
+
This cookbook also provides the java_ark LWRP which other java
8
+
cookbooks can use to install java-related applications from binary
9
+
packages.
5
10
6
11
---
7
12
Requirements
@@ -16,13 +21,16 @@ Platform
16
21
Cookbooks
17
22
---------
18
23
19
-
*apt
24
+
*java
20
25
21
26
---
22
27
Attributes
23
28
==========
24
29
25
-
*`node["java"]["install_flavor"]` - Flavor of JVM you would like installed (`sun` or `openjdk`), default `openjdk`.
30
+
*`node["java"]["install_flavor"]` - Flavor of JVM you would like installed (`oracle` or `openjdk`), default `openjdk`.
31
+
*`node['java']['java_home']`
32
+
*`node['java']['tarball']` - name of the tarball to retrieve from your corporate repository default `jdk1.6.0_29_i386.tar.gz`
33
+
*`node['java']['tarball_checksum']` - checksum for the tarball, if you use a different tarball, you also need to create a new sha256 checksum
26
34
27
35
---
28
36
Recipes
@@ -38,54 +46,114 @@ openjdk
38
46
39
47
This recipe installs the `openjdk` flavor of Java.
40
48
41
-
sun
49
+
oracle
42
50
---
43
51
44
-
This recipe installs the `sun` flavor of Java.
45
-
46
-
On Debian and Ubuntu systems the recipe will add the correct apt repository (`non-free` on Debian or `partner` on Ubuntu), pre-seed the package and update java alternatives.
47
-
48
-
On Red Hat flavored Linux (RHEL, CentOS, Fedora), the installation of the Sun flavor of Java is slightly more complicated as the `rpm` package is not readily available in any public Yum repository. The Sun JDK `rpm` package can be downloaded directly from Sun but comes wrapped as a compressed bin file. After the file has been downloaded, decompressed and license accepted the `rpm` package (names something like `jdk-6u25-ea-linux-amd64.rpm`) can be retrieved by this recipe using the `remote_file` or `cookbook_file` resources. The recipe will choose the correct resource based on the existence (or non-existence) of the `node['sun']['rpm_url']` attribute. See below for an example role using this attribute in the proper way. If you would like to deliver the `rpm` package file as part of this cookbook place the `rpm` package file in the `files/default` directory and the cookbook will retrieve the file during installation.
52
+
This recipe installs the `oracle` flavor of Java. This recipe does not
53
+
use distribution packages as Oracle changed the licensing terms with
54
+
JDK 1.6u27 and prohibited the practice for both the debian and EL worlds.
55
+
56
+
For both debian and centos/rhel, this recipe pulls the binary
57
+
distribution from the Oracle website, and installs it in the default
58
+
JAVA_HOME for each distribution. For debian/ubuntu, this is
59
+
/usr/lib/jvm/default-java. For Centos/RHEL, this is /usr/lib/jvm/java
60
+
61
+
After putting the binaries in place, the oracle recipe updates
62
+
/usr/bin/java to point to the installed JDK using the update-alternatives script
63
+
64
+
oracle_i386
65
+
-----------
66
+
67
+
This recipe installs the 32-bit Java virtual machine without setting it as the default. This can be useful if you have applications on the same machine that require different versions of the JVM.
68
+
69
+
Resources/Providers
70
+
===================
71
+
72
+
This LWRP provides an easy way to manage java applications. It uses
73
+
the LWRP arkive (deliberately misspelled). It is an arkive and not an
74
+
"archive" because the java_ark lwrp is not the same as a java archive
75
+
or "jar". Essentially, you provide the java_ark with the URL to a tarball and
76
+
the commands within the extracted result that you want symlinked to /usr/bin/
77
+
78
+
If you have a better name for this lwrp please contact the maintainer.
79
+
80
+
By default, the extracted directory is extracted to app_root/extracted_dir_name and symlinked to app_root/default
81
+
82
+
# Actions
83
+
84
+
- :install: extracts the tarball and makes necessary symlinks
85
+
- :remove: removes the tarball and run update-alternatives for all
86
+
symlinked bin_cmds
87
+
88
+
# Attribute Parameters
89
+
90
+
- url: path to tarball, .tar.gz, .bin (oracle-specific), and .zip
91
+
currently supported
92
+
- checksum: sha256 checksum, not used for security but avoid
93
+
redownloading the archive on each chef-client run
94
+
- app_home: the default for installations of this type of
95
+
application, for example, /usr/lib/tomcat/default. If your
96
+
application is not set to the default, it will be placed at the same
97
+
level in the directory hierarchy but the directory name will be
98
+
app_root/extracted_directory_name + "_alt"
99
+
- app_home_mode: file mode for app_home, is an integer
100
+
- bin_cmds: array of binary commands that should be symlinked to
101
+
/usr/bin, examples are mvn, java, javac, etc. These cmds must be in
102
+
the bin/ subdirectory of the extracted folder. Will be ignored if this
103
+
java_ark is not the default
104
+
- owner: owner of extracted directory, set to "root" by default
105
+
- default: whether this the default installation of this package,
0 commit comments