This is a cookbook for managing RabbitMQ with Chef. It uses the default settings, but can also be configured via attributes.
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 recipe is now combined with default. Recipe will now auto-cluster. Set
the :cluster attribute to true, :cluster_disk_nodes array of node@host
strings
that describe which you want to be disk nodes and then set an alphanumeric
string for the :erlang_cookie.
To enable SSL turn :ssl to true and set the paths to your cacert, cert and key files.
Uses a rabbitmq_users data-bag to create a set of user and vhosts for the node. The data-bag should be namespace that contains a hash that looks like the following:
{
"id" : "development"
,"users" : {
"username1" : {
"password" : "password1"
,"vhosts" : { "/vhost1" : "\".*\" \".*\" \".*\"" }
}
,"username2" : {
"password" : "password2"
,"vhosts" : { "/vhost2" : "\".*\" \".*\" \".*\"" }
}
,"admin" : {
"password" : "admin"
,"vhosts" : {
"/" : "\".*\" \".*\" \".*\""
,"/vhost1" : "\".*\" \".*\" \".*\""
,"/vhost2" : "\".*\" \".*\" \".*\""
}
,"tags" : [ "administrator" ]
}
}
}
There are 2 LWRPs for interacting with RabbitMQ.
Adds and deletes users, fairly simplistic permissions management, also allows one to manage the tags associated with an account.
:add
adds auser
with apassword
:delete
deletes auser
:set_permissions
sets thepermissions
for auser
,vhost
is optional:clear_permissions
clears the permissions for auser
:set_tags
sets thetags
for an account. Tags should be an array of strings.:clear_tags
clears all thetags
on an account
rabbitmq_user "guest" do
action :delete
end
rabbitmq_user "nova" do
password "sekret"
action :add
end
rabbitmq_user "nova" do
vhost "/nova"
permissions "\".*\" \".*\" \".*\""
action :set_permissions
end
rabbitmq_user "nova" do
tags ["administrator"]
action :set_tags
end
Adds and deletes vhosts.
:add
adds avhost
:delete
deletes avhost
rabbitmq_vhost "/nova" do
action :add
end
Enables and disables plugins
:enable
enables aplugin
. This is the default.:disable
disables aplugin
rabbitmq_plugin 'rabbitmq_management' do
action :enable
end
For an already running cluster, these actions still require manual intervention:
- changing the :erlang_cookie
- turning :cluster from true to false
The rabbitmq::chef recipe was only used for the chef-server cookbook and has been moved to chef-server::rabbitmq.
Author:: Benjamin Black [email protected] Author:: Daniel DeLeo [email protected] Author:: Gautam Dey [email protected] Author:: Matt Ray [email protected]
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.