Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

substantial update to rabbitmq for COOK-582

(cherry picked from commit 3628d26b4e1ce42b8b1ea440bdefc68d453f2746)
  • Loading branch information...
commit 172a3c97179d667765da4a53bb9f772bce087bec 1 parent 50d3a3c
@mattray mattray authored schisamo committed
View
7 README
@@ -1,7 +0,0 @@
-This is a cookbook for managing RabbitMQ with Chef. It has sane defaults, but can also be configured via attributes. It is quite useful as is, but has two areas for improvement:
-
-1) While it can create cluster configuration files, it does not currently do the dance to join the cluster members to each other.
-
-2) The Erlang run parameters are currently an opaque string. They should really be a set of tunables to be manipulated by name.
-
-Share and enjoy!
View
43 README.md
@@ -0,0 +1,43 @@
+Description
+===========
+This is a cookbook for managing RabbitMQ with Chef. It has sane defaults, but can also be configured via attributes.
+
+Recipes
+=======
+default
+-------
+Installs `rabbitmq-server` from RabbitMQ.com's APT repository. The distribution-provided version was quite old and newer features were needed.
+
+cluster
+-------
+Configures nodes to be members of a RabbitMQ cluster, but does not actually join them.
+
+Limitations
+===========
+It is quite useful as is, but has several areas for improvement:
+
+1) While it can create cluster configuration files, it does not currently do the dance to join the cluster members to each other.
+
+2) There should be LWRPs for manipulating vhosts, users and the `rabbitmq-server` service. Essentially everything you'd do with rabbitmqctl.
+
+The rabbitmq::chef recipe was only used for the chef-server cookbook and has been moved to chef-server::rabitmq.
+
+License and Author
+==================
+Author:: Benjamin Black <b@b3k.us>
+Author:: Daniel DeLeo <dan@kallistec.com>
+Author:: Matt Ray <matt@opscode.com>
+
+Copyright:: 2009-2011 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.
View
16 attributes/default.rb
@@ -1,12 +1,10 @@
-default[:rabbitmq][:nodename] = "rabbit"
-default[:rabbitmq][:address] = "0.0.0.0"
-default[:rabbitmq][:port] = "5672"
-default[:rabbitmq][:erl_args] = "+K true +A 30 \
--kernel inet_default_listen_options [{nodelay,true},{sndbuf,16384},{recbuf,4096}] \
--kernel inet_default_connect_options [{nodelay,true}]"
-default[:rabbitmq][:start_args] = ""
-default[:rabbitmq][:logdir] = "/var/log/rabbitmq"
-default[:rabbitmq][:mnesiadir] = "/var/lib/rabbitmq/mnesia"
+default[:rabbitmq][:nodename] = node[:hostname]
+default[:rabbitmq][:address] = nil
+default[:rabbitmq][:port] = nil
+default[:rabbitmq][:config] = nil
+default[:rabbitmq][:logdir] = nil
+default[:rabbitmq][:mnesiadir] = nil
+#clustering
default[:rabbitmq][:cluster] = "no"
default[:rabbitmq][:cluster_config] = "/etc/rabbitmq/rabbitmq_cluster.config"
default[:rabbitmq][:cluster_disk_nodes] = []
View
177 metadata.json
@@ -1,177 +0,0 @@
-{
- "name": "rabbitmq",
- "description": "Installs and configures RabbitMQ server",
- "long_description": "",
- "maintainer": "Benjamin Black",
- "maintainer_email": "b@b3k.us",
- "license": "Apache 2.0",
- "platforms": {
- "ubuntu": [
-
- ],
- "debian": [
-
- ]
- },
- "dependencies": {
- },
- "recommendations": {
- },
- "suggestions": {
- },
- "conflicting": {
- },
- "providing": {
- },
- "replacing": {
- },
- "attributes": {
- "rabbitmq": {
- "display_name": "RabbitMQ",
- "description": "Hash of RabbitMQ attributes",
- "type": "hash",
- "choice": [
-
- ],
- "calculated": false,
- "required": "optional",
- "recipes": [
-
- ]
- },
- "rabbitmq/nodename": {
- "display_name": "RabbitMQ Erlang node name",
- "description": "The Erlang node name for this server. The default is rabbit.",
- "default": "rabbit",
- "choice": [
-
- ],
- "calculated": false,
- "type": "string",
- "required": "optional",
- "recipes": [
-
- ]
- },
- "rabbitmq/address": {
- "display_name": "RabbitMQ server IP address",
- "description": "IP address to bind. The default is any.",
- "default": "0.0.0.0",
- "choice": [
-
- ],
- "calculated": false,
- "type": "string",
- "required": "optional",
- "recipes": [
-
- ]
- },
- "rabbitmq/port": {
- "display_name": "RabbitMQ server port",
- "description": "TCP port to bind. The default is 5672.",
- "default": "5672",
- "choice": [
-
- ],
- "calculated": false,
- "type": "string",
- "required": "optional",
- "recipes": [
-
- ]
- },
- "rabbitmq/logdir": {
- "display_name": "RabbitMQ log directory",
- "description": "Path to the directory for log files. The default is /var/log/rabbitmq.",
- "default": "/var/log/rabbitmq",
- "choice": [
-
- ],
- "calculated": false,
- "type": "string",
- "required": "optional",
- "recipes": [
-
- ]
- },
- "rabbitmq/mnesiadir": {
- "display_name": "RabbitMQ Mnesia database directory",
- "description": "Path to the directory for Mnesia database files. The default is /var/lib/rabbitmq/mnesia.",
- "default": "/var/lib/rabbitmq/mnesia",
- "choice": [
-
- ],
- "calculated": false,
- "type": "string",
- "required": "optional",
- "recipes": [
-
- ]
- },
- "rabbitmq/cluster": {
- "display_name": "RabbitMQ clustering",
- "description": "Whether to activate clustering. The default is no.",
- "default": "no",
- "choice": [
-
- ],
- "calculated": false,
- "type": "string",
- "required": "optional",
- "recipes": [
-
- ]
- },
- "rabbitmq/cluster_config": {
- "display_name": "RabbitMQ clustering configuration file",
- "description": "Path to the clustering configuration file, if cluster is yes. The default is /etc/rabbitmq/rabbitmq_cluster.config.",
- "default": "/etc/rabbitmq/rabbitmq_cluster.config",
- "choice": [
-
- ],
- "calculated": false,
- "type": "string",
- "required": "optional",
- "recipes": [
-
- ]
- },
- "rabbitmq/cluster_disk_nodes": {
- "display_name": "RabbitMQ cluster disk nodes",
- "description": "Array of member Erlang nodenames for the disk-based storage nodes in the cluster. The default is [].",
- "default": [
-
- ],
- "type": "array",
- "choice": [
-
- ],
- "calculated": false,
- "required": "optional",
- "recipes": [
-
- ]
- },
- "rabbitmq/erlang_cookie": {
- "display_name": "RabbitMQ Erlang cookie",
- "description": "Access cookie for clustering nodes. There is no default.",
- "choice": [
-
- ],
- "calculated": false,
- "type": "string",
- "required": "optional",
- "recipes": [
-
- ]
- }
- },
- "groupings": {
- },
- "recipes": {
- "rabbitmq": "Install and configure RabbitMQ",
- "rabbitmq::cluster": "Set up RabbitMQ clustering."
- },
- "version": "0.3.0"
-}
View
7 metadata.rb
@@ -1,10 +1,11 @@
-maintainer "Benjamin Black"
-maintainer_email "b@b3k.us"
+maintainer "Opscode, Inc."
+maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs and configures RabbitMQ server"
-version "0.3"
+version "1.1"
recipe "rabbitmq", "Install and configure RabbitMQ"
recipe "rabbitmq::cluster", "Set up RabbitMQ clustering."
+depends "apt", "> 1.1"
%w{ubuntu debian}.each do |os|
supports os
View
53 recipes/default.rb
@@ -3,13 +3,14 @@
# Recipe:: default
#
# Copyright 2009, Benjamin Black
+# Copyright 2009-2011, 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.
@@ -17,30 +18,34 @@
# limitations under the License.
#
-package "rabbitmq-server" do
- action :install
+# 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
-service "rabbitmq-server" do
- supports :status => true, :restart => true, :reload => true
- action [ :enable, :start ]
+# 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
+# because of this we just put the rabbitmq-env.conf in place and let it rip
+
+directory "/etc/rabbitmq/" do
+ owner "root"
+ group "root"
+ mode 0755
+ action :create
end
-case node[:platform]
-when "ubuntu"
- template "/etc/rabbitmq/rabbitmq.conf" do
- source "rabbitmq.config.erb"
- owner "root"
- group "root"
- mode 0644
- notifies :restart, resources(:service => "rabbitmq-server")
- end
-else
- template "/etc/rabbitmq/rabbitmq.config" do
- source "rabbitmq.config.erb"
- owner "root"
- group "root"
- mode 0644
- notifies :restart, resources(:service => "rabbitmq-server")
- end
+template "/etc/rabbitmq/rabbitmq-env.conf" do
+ source "rabbitmq-env.conf.erb"
+ owner "root"
+ group "root"
+ mode 0644
end
+
+package "rabbitmq-server"
+
View
10 templates/default/rabbitmq-env.conf.erb
@@ -0,0 +1,10 @@
+###
+# Generated by Chef for <%= node[:fqdn] %>
+###
+
+NODENAME=<%= node[:rabbitmq][:nodename] %>
+<% if node[:rabbitmq][:address] %>NODE_IP_ADDRESS=<%= node[:rabbitmq][:address] %><% end %>
+<% if node[:rabbitmq][:port] %>NODE_PORT=<%= node[:rabbitmq][:port] %><% end %>
+<% if node[:rabbitmq][:config] %>CONFIG_FILE=<%= node[:rabbitmq][:config] %><% end %>
+<% if node[:rabbitmq][:logdir] %>LOG_BASE=<%= node[:rabbitmq][:logdir] %><% end %>
+<% if node[:rabbitmq][:mnesiadir] %>MNESIA_BASE=<%= node[:rabbitmq][:mnesiadir] %><% end %>
View
12 templates/default/rabbitmq.config.erb
@@ -1,12 +0,0 @@
-###
-# Generated by Chef for <%= node[:fqdn] %>
-###
-
-NODENAME=<%= node[:rabbitmq][:nodename] %>
-NODE_IP_ADDRESS=<%= node[:rabbitmq][:address] %>
-NODE_PORT=<%= node[:rabbitmq][:port] %>
-SERVER_ERL_ARGS=<%= node[:rabbitmq][:erl_args] %>
-CLUSTER_CONFIG_FILE=<%= node[:rabbitmq][:cluster_config] %>
-LOG_BASE=<%= node[:rabbitmq][:logdir] %>
-MNESIA_BASE=<%= node[:rabbitmq][:mnesiadir] %>
-SERVER_START_ARGS=<%= node[:rabbitmq][:start_args] %>
Please sign in to comment.
Something went wrong with that request. Please try again.