Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'COOK-382'

* COOK-382:
  deprecated java_sun cookbook
  final tweaks for combined jdk cookbook
  first pass at a combined openjdk and sun java cookbook
  • Loading branch information...
commit 7325fa1bcfb26c36405996f38be6116004710432 2 parents c48813e + c7e5a7c
Seth Chisamore authored October 28, 2010
67  java/README.md
Source Rendered
... ...
@@ -0,0 +1,67 @@
  1
+Description
  2
+===========
  3
+
  4
+Installs a Java. Uses OpenJDK by default but supports installation of the Sun's Java (Debian and Ubuntu platforms only).
  5
+
  6
+Requirements
  7
+============
  8
+
  9
+Platform: 
  10
+
  11
+* Debian, Ubuntu (OpenJDK, Sun)
  12
+* CentOS, Red Hat, Fedora (OpenJDK)
  13
+
  14
+The following Opscode cookbooks are dependencies:
  15
+
  16
+* apt
  17
+
  18
+Attributes
  19
+==========
  20
+
  21
+* `node["java"]["install_flavor"]` - Type of JRE you would like installed ("sun" or "openjdk"), default "openjdk".
  22
+
  23
+Usage
  24
+=====
  25
+
  26
+Simply include the recipe where you want Java installed.
  27
+
  28
+If you would like to use the Sun flavor of Java, create a role and set the `java[install_flavor]` attribute to `'sun'`.  
  29
+
  30
+    % knife role show java
  31
+    {
  32
+      "name": "java",
  33
+      "chef_type": "role",
  34
+      "json_class": "Chef::Role",
  35
+      "default_attributes": {
  36
+        "java": {
  37
+          "install_flavor":"sun"
  38
+        }
  39
+      },
  40
+      "description": "",
  41
+      "run_list": [
  42
+        "recipe[java]"
  43
+      ],
  44
+      "override_attributes": {
  45
+      }
  46
+    }
  47
+
  48
+The Sun flavor of Java is only supported on Debian and Ubuntu systems, the recipe will preseed the package and update java alternatives.
  49
+
  50
+License and Author
  51
+==================
  52
+
  53
+Author:: Seth Chisamore (<schisamo@opscode.com>)
  54
+
  55
+Copyright:: 2008-2010, Opscode, Inc
  56
+
  57
+Licensed under the Apache License, Version 2.0 (the "License");
  58
+you may not use this file except in compliance with the License.
  59
+You may obtain a copy of the License at
  60
+
  61
+    http://www.apache.org/licenses/LICENSE-2.0
  62
+
  63
+Unless required by applicable law or agreed to in writing, software
  64
+distributed under the License is distributed on an "AS IS" BASIS,
  65
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  66
+See the License for the specific language governing permissions and
  67
+limitations under the License.
29  java/README.rdoc
Source Rendered
... ...
@@ -1,29 +0,0 @@
1  
-= DESCRIPTION:
2  
-
3  
-Installs Java and Ant. Uses OpenJDK, Sun's Java is deprecated in Ubuntu and may not be available in the future.
4  
-
5  
-= REQUIREMENTS:
6  
-
7  
-Platform: Ubuntu, Debian, Red Hat, CentOS, Fedora.
8  
-
9  
-Enable the 'multiverse' repository on Ubuntu, 'non-free' on Debian or EPEL on RH/Cent/Fedora to get the Java package, or edit the default recipe to point at the Java package for your platform.
10  
-
11  
-= USAGE:
12  
-
13  
-Simply include the recipe where you want Java installed. Note the repository requirement above to get the right package. On Debian and Ubuntu systems, the recipe will preseed the package and update java alternaties.
14  
-
15  
-= LICENSE and AUTHOR:
16  
-
17  
-Copyright 2008-2010, Opscode, Inc.
18  
-
19  
-Licensed under the Apache License, Version 2.0 (the "License");
20  
-you may not use this file except in compliance with the License.
21  
-You may obtain a copy of the License at
22  
-
23  
-    http://www.apache.org/licenses/LICENSE-2.0
24  
-
25  
-Unless required by applicable law or agreed to in writing, software
26  
-distributed under the License is distributed on an "AS IS" BASIS,
27  
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28  
-See the License for the specific language governing permissions and
29  
-limitations under the License.
26  java/attributes/default.rb
... ...
@@ -0,0 +1,26 @@
  1
+#
  2
+# Cookbook Name:: java
  3
+# Attributes:: default
  4
+#
  5
+# Copyright 2010, Opscode, Inc.
  6
+#
  7
+# Licensed under the Apache License, Version 2.0 (the "License");
  8
+# you may not use this file except in compliance with the License.
  9
+# You may obtain a copy of the License at
  10
+#
  11
+#     http://www.apache.org/licenses/LICENSE-2.0
  12
+#
  13
+# Unless required by applicable law or agreed to in writing, software
  14
+# distributed under the License is distributed on an "AS IS" BASIS,
  15
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16
+# See the License for the specific language governing permissions and
  17
+# limitations under the License.
  18
+
  19
+default["java"]["install_flavor"] = "openjdk"
  20
+
  21
+case platform
  22
+when "centos","redhat","fedora"
  23
+  set["java"]["java_home"] = "/usr/lib/jvm/java"
  24
+else
  25
+	set["java"]["java_home"] = "/usr/lib/jvm/default-java"
  26
+end
81  java/metadata.json
... ...
@@ -1,45 +1,48 @@
1 1
 {
2  
-    "recommendations": {
3  
-    },
4  
-    "attributes": {
5  
-    },
6  
-    "maintainer": "Opscode, Inc.",
7  
-    "suggestions": {
8  
-    },
9  
-    "dependencies": {
10  
-    },
11  
-    "maintainer_email": "cookbooks@opscode.com",
12  
-    "conflicting": {
13  
-    },
14  
-    "platforms": {
15  
-      "debian": [
  2
+  "providing": {
  3
+  },
  4
+  "maintainer": "Opscode, Inc.",
  5
+  "replacing": {
  6
+  },
  7
+  "description": "Installs java via openjdk.",
  8
+  "maintainer_email": "cookbooks@opscode.com",
  9
+  "groupings": {
  10
+  },
  11
+  "attributes": {
  12
+  },
  13
+  "recommendations": {
  14
+  },
  15
+  "dependencies": {
  16
+    "apt": [
16 17
 
17  
-      ],
18  
-      "fedora": [
  18
+    ]
  19
+  },
  20
+  "suggestions": {
  21
+  },
  22
+  "long_description": "Description\n===========\n\nInstalls a Java. Uses OpenJDK by default but supports installation of the Sun's Java (Debian and Ubuntu platforms only).\n\nRequirements\n============\n\nPlatform: \n\n* Debian, Ubuntu (OpenJDK, Sun)\n* CentOS, Red Hat, Fedora (OpenJDK)\n\nThe following Opscode cookbooks are dependencies:\n\n* apt\n\nAttributes\n==========\n\n* `node[\"java\"][\"install_flavor\"]` - Type of JRE you would like installed (\"sun\" or \"openjdk\"), default \"openjdk\".\n\nUsage\n=====\n\nSimply include the recipe where you want Java installed.\n\nIf you would like to use the Sun flavor of Java, create a role and set the `java[install_flavor]` attribute to `'sun'`.  \n\n    % knife role show java\n    {\n      \"name\": \"java\",\n      \"chef_type\": \"role\",\n      \"json_class\": \"Chef::Role\",\n      \"default_attributes\": {\n        \"java\": {\n          \"install_flavor\":\"sun\"\n        }\n      },\n      \"description\": \"\",\n      \"run_list\": [\n        \"recipe[java]\"\n      ],\n      \"override_attributes\": {\n      }\n    }\n\nThe Sun flavor of Java is only supported on Debian and Ubuntu systems, the recipe will preseed the package and update java alternatives.\n\nLicense and Author\n==================\n\nAuthor:: Seth Chisamore (<schisamo@opscode.com>)\n\nCopyright:: 2008-2010, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
  23
+  "platforms": {
  24
+    "debian": [
19 25
 
20  
-      ],
21  
-      "centos": [
  26
+    ],
  27
+    "fedora": [
22 28
 
23  
-      ],
24  
-      "ubuntu": [
  29
+    ],
  30
+    "centos": [
25 31
 
26  
-      ],
27  
-      "redhat": [
  32
+    ],
  33
+    "ubuntu": [
28 34
 
29  
-      ]
30  
-    },
31  
-    "license": "Apache 2.0",
32  
-    "version": "0.10.2",
33  
-    "providing": {
34  
-    },
35  
-    "recipes": {
36  
-      "java": "Installs openjdk to provide Java"
37  
-    },
38  
-    "replacing": {
39  
-    },
40  
-    "name": "java",
41  
-    "description": "Installs java via openjdk.",
42  
-    "groupings": {
43  
-    },
44  
-    "long_description": "= DESCRIPTION:\n\nInstalls Java and Ant. Uses OpenJDK, Sun's Java is deprecated in Ubuntu and may not be available in the future.\n\n= REQUIREMENTS:\n\nPlatform: Ubuntu, Debian, Red Hat, CentOS, Fedora.\n\nEnable the 'multiverse' repository on Ubuntu, 'non-free' on Debian or EPEL on RH/Cent/Fedora to get the Java package, or edit the default recipe to point at the Java package for your platform.\n\n= USAGE:\n\nSimply include the recipe where you want Java installed. Note the repository requirement above to get the right package. On Debian and Ubuntu systems, the recipe will preseed the package and update java alternaties.\n\n= LICENSE and AUTHOR:\n\nCopyright 2008-2010, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
45  
-  }
  35
+    ],
  36
+    "redhat": [
  37
+
  38
+    ]
  39
+  },
  40
+  "name": "java",
  41
+  "version": "0.10.2",
  42
+  "conflicting": {
  43
+  },
  44
+  "license": "Apache 2.0",
  45
+  "recipes": {
  46
+    "java": "Installs openjdk to provide Java"
  47
+  }
  48
+}
9  java/metadata.rb
@@ -2,11 +2,10 @@
2 2
 maintainer_email  "cookbooks@opscode.com"
3 3
 license           "Apache 2.0"
4 4
 description       "Installs java via openjdk."
5  
-long_description  IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
  5
+long_description  IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6 6
 version           "0.10.2"
7  
-
8  
-recipe "java", "Installs openjdk to provide Java"
9  
-
10  
-%w{ debian ubuntu redhat centos fedora }.each do |os|
  7
+depends "apt"
  8
+%w{ debian ubuntu centos redhat fedora }.each do |os|
11 9
   supports os
12 10
 end
  11
+recipe "java", "Installs openjdk to provide Java"
55  java/recipes/default.rb
@@ -2,7 +2,7 @@
2 2
 # Cookbook Name:: java
3 3
 # Recipe:: default
4 4
 #
5  
-# Copyright 2008-2009, Opscode, Inc.
  5
+# Copyright 2008-2010, Opscode, Inc.
6 6
 #
7 7
 # Licensed under the Apache License, Version 2.0 (the "License");
8 8
 # you may not use this file except in compliance with the License.
@@ -16,17 +16,48 @@
16 16
 # See the License for the specific language governing permissions and
17 17
 # limitations under the License.
18 18
 #
  19
+include_recipe "java::#{node["java"]["install_flavor"]}"
19 20
 
20  
-java_pkg = value_for_platform(
21  
-  [ "ubuntu", "debian" ] => {
22  
-    "default" => "openjdk-6-jre-headless"
23  
-  },
24  
-  [ "redhat", "centos", "fedora" ] => {
25  
-    "default" => "java-1.6.0-openjdk"
26  
-  },
27  
-  "default" => "openjdk-6-jre-headless"
28  
-)
  21
+current_java_version_pattern = (node.java.install_flavor == 'sun') ? /Java HotSpot\(TM\)/ : /^OpenJDK/
29 22
 
30  
-package java_pkg do
31  
-  action :install
  23
+# force ohai to run and pick up new languages.java data
  24
+ruby_block "reload_ohai" do
  25
+  block do
  26
+    o = Ohai::System.new
  27
+    o.all_plugins
  28
+    node.automatic_attrs.merge! o.data
  29
+  end
  30
+  action :nothing
32 31
 end
  32
+
  33
+execute "update-java-alternatives" do
  34
+  command "update-java-alternatives --jre -s java-6-#{node["java"]["install_flavor"]}"
  35
+  returns 0
  36
+  only_if do platform?("ubuntu", "debian") end
  37
+  action :nothing
  38
+  notifies :create, resources(:ruby_block => "reload_ohai")
  39
+end
  40
+
  41
+node.run_state[:java_pkgs].each do |pkg|
  42
+  package pkg do
  43
+    action :install
  44
+    if platform?("ubuntu", "debian")
  45
+      if node.java.install_flavor == "sun"
  46
+        response_file "java.seed"
  47
+      end
  48
+      notifies :run, resources(:execute => "update-java-alternatives"), :delayed
  49
+    end
  50
+  end
  51
+end
  52
+
  53
+# re-run update-java-alternatives if our java flavor changes
  54
+if node.languages.attribute?("java")
  55
+  unless node.languages.java.hotspot.name.match(current_java_version_pattern)
  56
+    log "Java install_flavor has changed, re-running 'update-java-alternatives'" do
  57
+      level :info
  58
+      notifies :run, resources(:execute => "update-java-alternatives"), :delayed
  59
+    end
  60
+  end
  61
+end
  62
+
  63
+node.run_state.delete(:java_pkgs)
27  java/recipes/openjdk.rb
... ...
@@ -0,0 +1,27 @@
  1
+#
  2
+# Cookbook Name:: java
  3
+# Recipe:: openjdk
  4
+#
  5
+# Copyright 2010, Opscode, Inc.
  6
+#
  7
+# Licensed under the Apache License, Version 2.0 (the "License");
  8
+# you may not use this file except in compliance with the License.
  9
+# You may obtain a copy of the License at
  10
+#
  11
+#     http://www.apache.org/licenses/LICENSE-2.0
  12
+#
  13
+# Unless required by applicable law or agreed to in writing, software
  14
+# distributed under the License is distributed on an "AS IS" BASIS,
  15
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16
+# See the License for the specific language governing permissions and
  17
+# limitations under the License.
  18
+
  19
+node.run_state[:java_pkgs] = value_for_platform(
  20
+  ["debian","ubuntu"] => {
  21
+    "default" => ["openjdk-6-jre","default-jre","icedtea6-plugin"] # icedtea6-plugin included to make update-java-alternatives work correctly
  22
+  },
  23
+  ["centos","redhat","fedora"] => {
  24
+    "default" => ["java-1.6.0-openjdk","java-1.6.0-openjdk-devel"]
  25
+  },
  26
+  "default" => ["openjdk-6-jre-headless","default-jre-headless","default-jre"]
  27
+)
37  java/recipes/sun.rb
... ...
@@ -0,0 +1,37 @@
  1
+#
  2
+# Cookbook Name:: java
  3
+# Recipe:: sun
  4
+#
  5
+# Copyright 2010, Opscode, Inc.
  6
+#
  7
+# Licensed under the Apache License, Version 2.0 (the "License");
  8
+# you may not use this file except in compliance with the License.
  9
+# You may obtain a copy of the License at
  10
+#
  11
+#     http://www.apache.org/licenses/LICENSE-2.0
  12
+#
  13
+# Unless required by applicable law or agreed to in writing, software
  14
+# distributed under the License is distributed on an "AS IS" BASIS,
  15
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16
+# See the License for the specific language governing permissions and
  17
+# limitations under the License.
  18
+
  19
+node.run_state[:java_pkgs] = value_for_platform(
  20
+  ["debian","ubuntu"] => {
  21
+    "default" => ["sun-java6-jre","default-jre-headless"]
  22
+  },
  23
+  "default" => ["sun-java6-jre"]
  24
+)
  25
+
  26
+case node.platform
  27
+when "debian","ubuntu"
  28
+  include_recipe "apt"
  29
+ 
  30
+  template "/etc/apt/sources.list.d/canonical.com.list" do
  31
+    mode "0644"
  32
+    source "canonical.com.list.erb"
  33
+    notifies :run, resources(:execute => "apt-get update"), :immediately
  34
+  end
  35
+else
  36
+  Chef::Log.error("Installation of Sun Java packages are only supported on Debian/Ubuntu at this time.")
  37
+end
0  java_sun/templates/default/canonical.com.list.erb → java/templates/ubuntu/canonical.com.list.erb
File renamed without changes
8  java_sun/README.rdoc
Source Rendered
... ...
@@ -1,16 +1,16 @@
1 1
 = DESCRIPTION:
2 2
 
3  
-Installs Sun Java.
  3
+THIS COOKBOOK HAS BEEN DEPRECATED.  Please use the `java` cookbook with the proper `install_flavor` attribute set.
  4
+
  5
+The default recipe in this cookbook simply points to the `java::default` recipe with the proper `node["java"]["install_flavor"]` attribute set to `sun`
4 6
 
5 7
 = REQUIREMENTS:
6 8
 
7 9
 Platform: Ubuntu, Debian.
8 10
 
9  
-Enable the 'multiverse' repository on Ubuntu, 'non-free' on Debian, or edit the default recipe to point at the Java package for your platform.
10  
-
11 11
 = USAGE:
12 12
 
13  
-Simply include the recipe where you want Java installed. Note the respository requirement above to get the right package. On Debian and Ubuntu systems, the recipe will preseed the package and update java alternaties.
  13
+Simply include the recipe where you want Sun Java installed.
14 14
 
15 15
 = LICENSE and AUTHOR:
16 16
 
11  java_sun/files/default/java.seed
... ...
@@ -1,11 +0,0 @@
1  
-sun-java6-bin	shared/accepted-sun-dlj-v1-1	boolean	true
2  
-sun-java6-jdk	shared/accepted-sun-dlj-v1-1	boolean	true
3  
-sun-java6-jre	shared/accepted-sun-dlj-v1-1	boolean	true
4  
-sun-java6-jre	sun-java6-jre/stopthread	boolean	true
5  
-sun-java6-jre	sun-java6-jre/jcepolicy	note	
6  
-sun-java6-bin	shared/error-sun-dlj-v1-1	error	
7  
-sun-java6-jdk	shared/error-sun-dlj-v1-1	error	
8  
-sun-java6-jre	shared/error-sun-dlj-v1-1	error	
9  
-sun-java6-bin	shared/present-sun-dlj-v1-1	note	
10  
-sun-java6-jdk	shared/present-sun-dlj-v1-1	note	
11  
-sun-java6-jre	shared/present-sun-dlj-v1-1	note	
69  java_sun/metadata.json
... ...
@@ -1,36 +1,39 @@
1 1
 {
2  
-    "recommendations": {
3  
-    },
4  
-    "attributes": {
5  
-    },
6  
-    "maintainer": "Opscode, Inc.",
7  
-    "suggestions": {
8  
-    },
9  
-    "dependencies": {
10  
-    },
11  
-    "maintainer_email": "cookbooks@opscode.com",
12  
-    "conflicting": {
13  
-    },
14  
-    "platforms": {
15  
-      "debian": [
  2
+  "providing": {
  3
+  },
  4
+  "maintainer": "Opscode, Inc.",
  5
+  "replacing": {
  6
+  },
  7
+  "description": "Installs Sun java",
  8
+  "maintainer_email": "cookbooks@opscode.com",
  9
+  "groupings": {
  10
+  },
  11
+  "attributes": {
  12
+  },
  13
+  "recommendations": {
  14
+  },
  15
+  "dependencies": {
  16
+    "java": [
16 17
 
17  
-      ],
18  
-      "ubuntu": [
  18
+    ]
  19
+  },
  20
+  "suggestions": {
  21
+  },
  22
+  "long_description": "= DESCRIPTION:\n\nTHIS COOKBOOK HAS BEEN DEPRECATED.  Please use the `java` cookbook with the proper `install_flavor` attribute set.\n\nThe default recipe in this cookbook simply points to the `java::default` recipe with the proper `node[\"java\"][\"install_flavor\"]` attribute set to `sun`\n\n= REQUIREMENTS:\n\nPlatform: Ubuntu, Debian.\n\n= USAGE:\n\nSimply include the recipe where you want Sun Java installed.\n\n= LICENSE and AUTHOR:\n\nCopyright 2008-2010, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
  23
+  "platforms": {
  24
+    "debian": [
19 25
 
20  
-      ]
21  
-    },
22  
-    "license": "Apache 2.0",
23  
-    "version": "0.9.2",
24  
-    "providing": {
25  
-    },
26  
-    "recipes": {
27  
-      "java_sun": "Installs Sun Java using preseed to accept terms"
28  
-    },
29  
-    "replacing": {
30  
-    },
31  
-    "name": "java_sun",
32  
-    "description": "Installs Sun java",
33  
-    "groupings": {
34  
-    },
35  
-    "long_description": "= DESCRIPTION:\n\nInstalls Sun Java.\n\n= REQUIREMENTS:\n\nPlatform: Ubuntu, Debian.\n\nEnable the 'multiverse' repository on Ubuntu, 'non-free' on Debian, or edit the default recipe to point at the Java package for your platform.\n\n= USAGE:\n\nSimply include the recipe where you want Java installed. Note the respository requirement above to get the right package. On Debian and Ubuntu systems, the recipe will preseed the package and update java alternaties.\n\n= LICENSE and AUTHOR:\n\nCopyright 2008-2010, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
36  
-  }
  26
+    ],
  27
+    "ubuntu": [
  28
+
  29
+    ]
  30
+  },
  31
+  "name": "java_sun",
  32
+  "version": "0.9.2",
  33
+  "conflicting": {
  34
+  },
  35
+  "license": "Apache 2.0",
  36
+  "recipes": {
  37
+    "java_sun": "Installs Sun Java using preseed to accept terms"
  38
+  }
  39
+}
2  java_sun/metadata.rb
@@ -5,6 +5,8 @@
5 5
 long_description  IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
6 6
 version           "0.9.2"
7 7
 
  8
+depends 'java'
  9
+
8 10
 recipe "java_sun", "Installs Sun Java using preseed to accept terms"
9 11
 
10 12
 %w{ debian ubuntu }.each do |os|
34  java_sun/recipes/default.rb
@@ -17,36 +17,8 @@
17 17
 # limitations under the License.
18 18
 #
19 19
 
20  
-java_pkg = value_for_platform(
21  
-  [ "ubuntu", "debian" ] => {
22  
-    "default" => "sun-java6-jdk"
23  
-  },
24  
-  "default" => "sun-java6-jdk"
25  
-)
  20
+Chef::Log.warn("This recipe will be deprecated soon, please use java::default")
26 21
 
27  
-case node.platform
28  
-when "ubuntu" 
29  
-  include_recipe "apt"
30  
- 
31  
-  template "/etc/apt/sources.list.d/canonical.com.list" do
32  
-    mode "0644"
33  
-    source "canonical.com.list.erb"
34  
-    notifies :run, resources(:execute => "apt-get update"), :immediately
35  
-  end
36  
-end
  22
+node["java"]["install_flavor"] = "sun"
37 23
 
38  
-execute "update-java-alternatives" do
39  
-  command "update-java-alternatives --jre-headless -s java-6-sun"
40  
-  only_if do platform?("ubuntu", "debian") end
41  
-  ignore_failure true
42  
-  returns 0
43  
-  action :nothing
44  
-end
45  
-
46  
-package java_pkg do
47  
-  action :install
48  
-  if platform?("ubuntu", "debian")
49  
-    response_file "java.seed"
50  
-    notifies :run, resources(:execute => "update-java-alternatives"), :immediately
51  
-  end
52  
-end
  24
+include_recipe "java"

0 notes on commit 7325fa1

Please sign in to comment.
Something went wrong with that request. Please try again.