From a04c4cae615ee6e368e91971c429cdc7385a045e Mon Sep 17 00:00:00 2001 From: mattray Date: Fri, 16 Sep 2011 23:23:00 -0500 Subject: [PATCH] get rabbitmq from upstream maintainer for CentOS/RHEL/Scientific, COOK-758 --- rabbitmq/README.md | 2 +- rabbitmq/metadata.rb | 8 +++++--- rabbitmq/recipes/default.rb | 33 +++++++++++++++++++++------------ 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/rabbitmq/README.md b/rabbitmq/README.md index 9d47d5a00..a94d774ff 100644 --- a/rabbitmq/README.md +++ b/rabbitmq/README.md @@ -6,7 +6,7 @@ Recipes ======= default ------- -Installs `rabbitmq-server` from RabbitMQ.com's APT repository. The distribution-provided version was quite old and newer features were needed. +Installs `rabbitmq-server` from RabbitMQ.com's APT repository or the RPM directly (there is no yum repo). The distribution-provided versions were quite old and newer features were needed. cluster ------- diff --git a/rabbitmq/metadata.rb b/rabbitmq/metadata.rb index c7d2425c8..c98129f02 100644 --- a/rabbitmq/metadata.rb +++ b/rabbitmq/metadata.rb @@ -2,12 +2,14 @@ maintainer_email "cookbooks@opscode.com" license "Apache 2.0" description "Installs and configures RabbitMQ server" -version "1.2.1" +version "1.3" recipe "rabbitmq", "Install and configure RabbitMQ" recipe "rabbitmq::cluster", "Set up RabbitMQ clustering." -depends "apt", "> 1.1" +depends "apt", ">= 1.1" +depends "yum", ">= 0.5.0" +depends "erlang", ">= 0.9" -%w{ubuntu debian}.each do |os| +%w{ubuntu debian redhat centos scientific}.each do |os| supports os end diff --git a/rabbitmq/recipes/default.rb b/rabbitmq/recipes/default.rb index 24edcb8b5..a3c77efdc 100644 --- a/rabbitmq/recipes/default.rb +++ b/rabbitmq/recipes/default.rb @@ -18,16 +18,6 @@ # limitations under the License. # -# use the RabbitMQ repository instead of Ubuntu or Debian's -# because there are very useful features in the newer versions -apt_repository "rabbitmq" do - uri "http://www.rabbitmq.com/debian/" - distribution "testing" - components ["main"] - key "http://www.rabbitmq.com/rabbitmq-signing-key-public.asc" - action :add -end - # rabbitmq-server is not well-behaved as far as managed services goes # we'll need to add a LWRP for calling rabbitmqctl stop # while still using /etc/init.d/rabbitmq-server start @@ -47,5 +37,24 @@ mode 0644 end -package "rabbitmq-server" - +case node[:platform] +when "debian", "ubuntu" + # use the RabbitMQ repository instead of Ubuntu or Debian's + # because there are very useful features in the newer versions + apt_repository "rabbitmq" do + uri "http://www.rabbitmq.com/debian/" + distribution "testing" + components ["main"] + key "http://www.rabbitmq.com/rabbitmq-signing-key-public.asc" + action :add + end + package "rabbitmq-server" +when "redhat", "centos", "scientific" + remote_file "/tmp/rabbitmq-server-2.6.1-1.noarch.rpm" do + source "https://www.rabbitmq.com/releases/rabbitmq-server/v2.6.1/rabbitmq-server-2.6.1-1.noarch.rpm" + action :create_if_missing + end + rpm_package "/tmp/rabbitmq-server-2.6.1-1.noarch.rpm" do + action :install + end +end