From db5a8473863fb3e7b24ffa0e7f9478516fb06b79 Mon Sep 17 00:00:00 2001 From: Joshua Sierles Date: Tue, 1 Dec 2009 13:50:46 +0100 Subject: [PATCH 1/4] Merge branch 'master' of /Volumes/37s/chef_recipes Conflicts: .gitignore Rakefile config/solo.rb --- cc.gemspec | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 cc.gemspec diff --git a/cc.gemspec b/cc.gemspec new file mode 100644 index 0000000..5f71531 --- /dev/null +++ b/cc.gemspec @@ -0,0 +1,36 @@ +# -*- encoding: utf-8 -*- +lib = File.expand_path('../',__FILE__) +lib_up = File.expand_path('../../', __FILE__) +$:.unshift lib unless $:.include?(lib) +$:.unshift lib_up unless $:.include?(lib_up) +require 'json' + +ENV['GEM_PATH']=ENV['BUNDLE_INSTALL_PATH'] if ENV['BUNDLE_INSTALL_PATH'] +ENV['GEM_HOME']=ENV['BUNDLE_INSTALL_PATH'] if ENV['BUNDLE_INSTALL_PATH'] + +name = File.split(lib)[-1]||"" +raise ArgumentError, '', caller if name.empty? +@name=name + +Gem.use_paths(ENV['BUNDLE_INSTALL_PATH'],[]) if ENV['BUNDLE_INSTALL_PATH'] + +Gem::Specification.new do |s| + + md = JSON.parse(File.read(File.expand_path('../metadata.json', __FILE__))) + + # Required attributes (gem build fails without these) + s.name = @name + s.version = md['version'] && !md['version'].empty? ? md['version'] : '0' + s.files = Dir.glob('**/*') #.map{|f| File.expand_path(f)} + s.summary = md['description'] ? md['description'] : "The Chef cookbook for #{s.name}" + + # Optional attributes (gem build warning raised without these) + s.author = md['maintainer'] ? md['maintainer'] : 'No acknowledged maintainer' + s.description = md['long_description'] ? md['long_description'] : s.summary + s.email = md['maintainer_email'] ? md['maintainer_email'] : 'No acknowledged maintainer email' + s.homepage = 'http://www.opscode.com' + md['dependencies'].each { |k,v| s.add_dependency(k,v) }; + + s.post_install_message = "Installed Chef Cookbook #{s.name}\n#{s.description}" + +end From a5c5ec1215a03c188111d78d12ec31625afb3cb8 Mon Sep 17 00:00:00 2001 From: Joshua Sierles Date: Fri, 11 Dec 2009 01:13:17 +0100 Subject: [PATCH 2/4] finish move of recipes to top level --- files/default/java.seed | 11 +++++++++++ metadata.json | 38 ++++++++++++++++++++++++++++++++++++++ metadata.rb | 4 ++++ recipes/default.rb | 28 ++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 files/default/java.seed create mode 100644 metadata.json create mode 100644 metadata.rb create mode 100644 recipes/default.rb diff --git a/files/default/java.seed b/files/default/java.seed new file mode 100644 index 0000000..bf44093 --- /dev/null +++ b/files/default/java.seed @@ -0,0 +1,11 @@ +sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true +sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true +sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true +sun-java6-jre sun-java6-jre/stopthread boolean true +sun-java6-jre sun-java6-jre/jcepolicy note +sun-java6-bin shared/error-sun-dlj-v1-1 error +sun-java6-jdk shared/error-sun-dlj-v1-1 error +sun-java6-jre shared/error-sun-dlj-v1-1 error +sun-java6-bin shared/present-sun-dlj-v1-1 note +sun-java6-jdk shared/present-sun-dlj-v1-1 note +sun-java6-jre shared/present-sun-dlj-v1-1 note \ No newline at end of file diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..256a714 --- /dev/null +++ b/metadata.json @@ -0,0 +1,38 @@ +{ + "replacing": { + + }, + "long_description": "", + "attributes": { + + }, + "maintainer": "37signals", + "recommendations": { + + }, + "license": "Apache v2.0", + "recipes": { + "java": "" + }, + "maintainer_email": "sysadmins@37signals.com", + "suggestions": { + + }, + "dependencies": { + + }, + "conflicting": { + + }, + "platforms": { + + }, + "description": "Configures java", + "version": "0.1.0", + "name": "java", + "providing": { + "java": [ + + ] + } +} \ No newline at end of file diff --git a/metadata.rb b/metadata.rb new file mode 100644 index 0000000..7aa6150 --- /dev/null +++ b/metadata.rb @@ -0,0 +1,4 @@ +maintainer "37signals" +maintainer_email "sysadmins@37signals.com" +description "Configures java" +version "0.1" diff --git a/recipes/default.rb b/recipes/default.rb new file mode 100644 index 0000000..63afaaa --- /dev/null +++ b/recipes/default.rb @@ -0,0 +1,28 @@ +java_pkg = value_for_platform( + "ubuntu" => { + "default" => "sun-java6-jdk" + }, + "debian" => { + "default" => "sun-java6-jdk" + }, + "default" => "sun-java6-jdk" +) + +execute "update-java-alternatives" do + command "update-java-alternatives -s java-6-sun" + only_if do platform?("ubuntu", "debian") end + ignore_failure true + returns 1 + action :nothing +end + +package java_pkg do + response_file "java.seed" + action :install + notifies :run, resources(:execute => "update-java-alternatives"), :immediately +end + +package "ant" + + + From 594f8e2a424bfa21803f06cb7f52e64a2b1fcac9 Mon Sep 17 00:00:00 2001 From: Joshua Sierles Date: Tue, 6 Apr 2010 14:52:29 +0200 Subject: [PATCH 3/4] major updates for 0.8 compatibility. some recipes now use databags by default. --- metadata.json | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/metadata.json b/metadata.json index 256a714..3f3faff 100644 --- a/metadata.json +++ b/metadata.json @@ -1,38 +1,41 @@ { - "replacing": { + "groupings": { }, - "long_description": "", - "attributes": { + "recommendations": { }, - "maintainer": "37signals", - "recommendations": { + "platforms": { }, "license": "Apache v2.0", - "recipes": { - "java": "" - }, - "maintainer_email": "sysadmins@37signals.com", + "maintainer": "37signals", "suggestions": { }, - "dependencies": { - - }, + "maintainer_email": "sysadmins@37signals.com", + "version": "0.1.0", "conflicting": { - }, - "platforms": { - }, "description": "Configures java", - "version": "0.1.0", - "name": "java", "providing": { "java": [ ] + }, + "name": "java", + "attributes": { + + }, + "long_description": "", + "recipes": { + "java": "" + }, + "replacing": { + + }, + "dependencies": { + } } \ No newline at end of file From a3a96d9a2bed796cd2d05380a712e2a801547ad9 Mon Sep 17 00:00:00 2001 From: Joshua Sierles Date: Tue, 13 Jul 2010 17:46:52 +0200 Subject: [PATCH 4/4] update to chef 0.9. Prefer nginx/unicorn over passenger. Too many other changes to mention here. --- README.rdoc | 29 +++++++++++++++++++++++++++++ metadata.rb | 14 ++++++++++---- recipes/default.rb | 44 ++++++++++++++++++++++++-------------------- 3 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 README.rdoc diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..8e9d148 --- /dev/null +++ b/README.rdoc @@ -0,0 +1,29 @@ += DESCRIPTION: + +Installs Java and Ant. + += REQUIREMENTS: + +Platform: Ubuntu, Debian, Red Hat, CentOS, Fedora. + +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. + += USAGE: + +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. + += LICENSE and AUTHOR: + +Copyright 2008-2010, Opscode, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/metadata.rb b/metadata.rb index 7aa6150..0bf7e10 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,4 +1,10 @@ -maintainer "37signals" -maintainer_email "sysadmins@37signals.com" -description "Configures java" -version "0.1" +maintainer "Opscode, Inc." +maintainer_email "cookbooks@opscode.com" +license "Apache 2.0" +description "Installs java" +long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc')) +version "0.10.0" + +%w{ debian ubuntu redhat centos fedora }.each do |os| + supports os +end diff --git a/recipes/default.rb b/recipes/default.rb index 63afaaa..66f5db0 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,28 +1,32 @@ +# +# Cookbook Name:: java +# Recipe:: default +# +# Copyright 2008-2009, Opscode, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + java_pkg = value_for_platform( - "ubuntu" => { - "default" => "sun-java6-jdk" + [ "ubuntu", "debian" ] => { + "default" => "openjdk-6-jre-headless" }, - "debian" => { - "default" => "sun-java6-jdk" + [ "redhat", "centos", "fedora" ] => { + "default" => "java-1.6.0-openjdk" }, - "default" => "sun-java6-jdk" + "default" => "openjdk-6-jre-headless" ) -execute "update-java-alternatives" do - command "update-java-alternatives -s java-6-sun" - only_if do platform?("ubuntu", "debian") end - ignore_failure true - returns 1 - action :nothing -end - package java_pkg do - response_file "java.seed" action :install - notifies :run, resources(:execute => "update-java-alternatives"), :immediately end - -package "ant" - - -