diff --git a/README.md b/README.md index a1468136..3367b420 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,8 @@ Attributes See `attributes/default.rb` for default values. -* `node["java"]["install_flavor"]` - Flavor of JVM you would like installed (`oracle` or -`openjdk`), default `openjdk`. +* `node["java"]["install_flavor"]` - Flavor of JVM you would like installed (`oracle`, +`openjdk` or `package`), default `openjdk`. * `node['java']['java_home']` - Default location of the "`$JAVA_HOME`". * `node['java']['tarball']` - Name of the tarball to retrieve from your corporate repository default `jdk1.6.0_29_i386.tar.gz` @@ -78,7 +78,7 @@ default Include the default recipe in a run list, to get `java`. By default the `openjdk` flavor of Java is installed, but this can be changed by -using the `install_flavor` attribute. If the platform is windows it +using the `install_flavor` attribute. If the platform is windows it will include the windows recipe instead. OpenJDK is the default because of licensing changes made upstream by @@ -112,10 +112,18 @@ 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. +package +------- + +This recipe installs JDK from your yum/apt repository using the standard +chef package resource. This options is useful if you do not give a fuck +about Oracle's licensing and just want to use the package you have in your +repo. + windows ------- -Because there is no easy way to pull the java msi off oracle's site, +Because there is no easy way to pull the java msi off oracle's site, this recipe requires you to host it internally on your own http repo. Resources/Providers diff --git a/attributes/default.rb b/attributes/default.rb index 4c0d9c51..ca087c10 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -23,6 +23,7 @@ # default jdk attributes default['java']['install_flavor'] = "openjdk" default['java']['jdk_version'] = '6' +default['java']['jdk_package_version'] = '1.7.0_15' default['java']['arch'] = kernel['machine'] =~ /x86_64/ ? "x86_64" : "i586" case platform @@ -46,10 +47,10 @@ # direct download paths for oracle, you have been warned! # jdk6 attributes -default['java']['jdk']['6']['bin_cmds'] = [ "appletviewer", "apt", "ControlPanel", "extcheck", "HtmlConverter", "idlj", "jar", "jarsigner", - "java", "javac", "javadoc", "javah", "javap", "javaws", "jconsole", "jcontrol", "jdb", "jhat", - "jinfo", "jmap", "jps", "jrunscript", "jsadebugd", "jstack", "jstat", "jstatd", "jvisualvm", - "keytool", "native2ascii", "orbd", "pack200", "policytool", "rmic", "rmid", "rmiregistry", +default['java']['jdk']['6']['bin_cmds'] = [ "appletviewer", "apt", "ControlPanel", "extcheck", "HtmlConverter", "idlj", "jar", "jarsigner", + "java", "javac", "javadoc", "javah", "javap", "javaws", "jconsole", "jcontrol", "jdb", "jhat", + "jinfo", "jmap", "jps", "jrunscript", "jsadebugd", "jstack", "jstat", "jstatd", "jvisualvm", + "keytool", "native2ascii", "orbd", "pack200", "policytool", "rmic", "rmid", "rmiregistry", "schemagen", "serialver", "servertool", "tnameserv", "unpack200", "wsgen", "wsimport", "xjc" ] # x86_64 @@ -62,10 +63,10 @@ # jdk7 attributes -default['java']['jdk']['7']['bin_cmds'] = [ "appletviewer", "apt", "ControlPanel", "extcheck", "idlj", "jar", "jarsigner", "java", "javac", - "javadoc", "javafxpackager", "javah", "javap", "javaws", "jcmd", "jconsole", "jcontrol", "jdb", - "jhat", "jinfo", "jmap", "jps", "jrunscript", "jsadebugd", "jstack", "jstat", "jstatd", "jvisualvm", - "keytool", "native2ascii", "orbd", "pack200", "policytool", "rmic", "rmid", "rmiregistry", +default['java']['jdk']['7']['bin_cmds'] = [ "appletviewer", "apt", "ControlPanel", "extcheck", "idlj", "jar", "jarsigner", "java", "javac", + "javadoc", "javafxpackager", "javah", "javap", "javaws", "jcmd", "jconsole", "jcontrol", "jdb", + "jhat", "jinfo", "jmap", "jps", "jrunscript", "jsadebugd", "jstack", "jstat", "jstatd", "jvisualvm", + "keytool", "native2ascii", "orbd", "pack200", "policytool", "rmic", "rmid", "rmiregistry", "schemagen", "serialver", "servertool", "tnameserv", "unpack200", "wsgen", "wsimport", "xjc" ] # x86_64 diff --git a/recipes/packages.rb b/recipes/packages.rb new file mode 100644 index 00000000..522fb9b2 --- /dev/null +++ b/recipes/packages.rb @@ -0,0 +1,5 @@ +# This recipe assumes you have jdk package somewhere in your apt/yum repository and installs it from there +package "jdk" do + action :install + version node.java.jdk_package_version +end