Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

rabbitmq (90) Versions 4.2.1

Installs and configures RabbitMQ server

Policyfile
Berkshelf
Knife
cookbook 'rabbitmq', '= 4.2.1', :supermarket
cookbook 'rabbitmq', '= 4.2.1'
knife supermarket install rabbitmq
knife supermarket download rabbitmq
README
Dependencies
Changelog
Quality 0%

rabbitmq Cookbook

Build Status

This is a cookbook for managing RabbitMQ with Chef. It is intended for RabbitMQ 2.6.1 or later releases. With Chef we have adopted support >= 11.14.0 for chef-client, and leaning heavily on chef-client 12 and above.

Requirements

This cookbook depends on the erlang cookbook.

The release was tested with (rabbitmq.com/distro version), from the [kitchen.yml](.kitchen.cloud.yml).

  • CentOS 6.5
  • CentOS 7.0
  • Ubuntu 12.04
  • Ubuntu 14.04
  • Debian 7.0

Recipes

default

Installs rabbitmq-server from RabbitMQ.com via direct download of the installation package or using the distribution version. Depending on your distribution, the provided version may be quite old so they are disabled by default. If you want to use the distro version, set the attribute ['rabbitmq']['use_distro_version'] to true. You may override the download URL attribute ['rabbitmq']['package'] if you wish to use a local mirror.

The cluster recipe is now combined with the default and will now auto-cluster. Set the ['rabbitmq']['cluster'] attribute to true, ['rabbitmq']['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.

Attributes

Default values and usage information of important attributes are shown below. More attributes are documented in metadata.rb.

Username and Password

The default username and password are guest/guest:

['rabbitmq']['default_user'] = 'guest'

['rabbitmq']['default_pass'] = 'guest'

Loopback Users

By default, the guest user can only connect via localhost. This is the behavior of RabbitMQ when the loopback_users configuration is not specified in it's configuration file. Also, by default, this cookbook does not specify loopback_users in the configuration file:

['rabbitmq']['loopback_users'] = nil

If you wish to allow the default guest user to connect remotely, you can change this to []. If instead you wanted to allow just the user 'foo' to connect over loopback, you would set this value to ["foo"]. More information can be found here: https://www.rabbitmq.com/access-control.html.

mgmt_console

Installs the rabbitmq_management and rabbitmq_management_visualiser plugins.
To use https connection to management console, turn ['rabbitmq']['web_console_ssl'] to true. The SSL port for web management console can be configured by setting attribute ['rabbitmq']['web_console_ssl_port'], whose default value is 15671.

plugin_management

Enables any plugins listed in the node['rabbitmq']['enabled_plugins'] and disables any listed in node['rabbitmq']['disabled_plugins'] attributes.

community_plugins

Downloads, installs and enables pre-built community plugins binaries.

To specify a plugin, set the attribute node['rabbitmq']['community_plugins']['PLUGIN_NAME'] to 'DOWNLOAD_URL'. For example, to use the RabbitMQ priority queue plugin, set the attribute node['rabbitmq']['community_plugins']['rabbitmq_priority_queue'] to 'https://www.rabbitmq.com/community-plugins/v3.4.x/rabbitmq_priority_queue-3.4.x-3431dc1e.ez'.

policy_management

Enables any policies listed in the node['rabbitmq']['policies'] and disables any listed in node['rabbitmq']['disabled_policies'] attributes.

user_management

Enables any users listed in the node['rabbitmq']['enabled_users'] and disables any listed in node['rabbitmq']['disabled_users'] attributes.

virtualhost_management

Enables any vhosts listed in the node['rabbitmq']['virtualhosts'] and disables any listed in node['rabbitmq']['disabled_virtualhosts'] attributes.

cluster

Configure the cluster between the nodes in the node['rabbitmq']['clustering']['cluster_nodes'] attribute. It also, supports the auto or manual clustering.
* Auto clustering : Use auto-configuration of RabbitMQ, http://www.rabbitmq.com/clustering.html#auto-config
* Manual clustering : Configure the cluster by executing rabbitmqctl join_cluster command.

  • node['rabbitmq']['cluster'] : Default decision flag of clustering
  • node['rabbitmq']['erlang_cookie'] : Same erlang cookie is required for the cluster
  • node['rabbitmq']['clustering']['use\_auto_clustering'] : Default is false. (manual clustering is default)
  • node['rabbitmq']['clustering']['cluster_name'] : Name of cluster. default value is nil. In case of nil or '' is set for cluster_name, first node name in node['rabbitmq']['clustering']['cluster_nodes'] attribute will be set for manual clustering. for the auto clustering, one of the node name will be set.
  • node['rabbitmq']['clustering']['cluster_nodes'] : List of cluster nodes. it required node name and cluster node type. please refer to example in below.

Attributes example
ruby
node['rabbitmq']['cluster'] = true
node['rabbitmq']['erlang_cookie'] = 'AnyAlphaNumericStringWillDo'
node['rabbitmq']['cluster_partition_handling'] = 'ignore'
node['rabbitmq']['clustering']['use_auto_clustering'] = false
node['rabbitmq']['clustering']['cluster_name'] = 'seoul_tokyo_newyork'
node['rabbitmq']['clustering']['cluster_nodes'] = [
{
:name => 'rabbit@rabbit1',
:type => 'disc'
},
{
:name => 'rabbit@rabbit2',
:type => 'ram'
},
{
:name => 'rabbit@rabbit3',
:type => 'disc'
}
]

Resources/Providers

There are 5 LWRPs for interacting with RabbitMQ.

plugin

Enables or disables a rabbitmq plugin. Plugins are not supported for releases prior to 2.7.0.

  • :enable enables a plugin
  • :disable disables a plugin

Examples

rabbitmq_plugin "rabbitmq_stomp" do
  action :enable
end
rabbitmq_plugin "rabbitmq_shovel" do
  action :disable
end

policy

sets or clears a rabbitmq policy.

  • :set sets a policy
  • :clear clears a policy
  • :list lists policys

Examples

rabbitmq_policy "ha-all" do
  pattern "^(?!amq\\.).*"
  params ({"ha-mode"=>"all"})
  priority 1
  action :set
end
rabbitmq_policy "ha-all" do
  action :clear
end

user

Adds and deletes users, fairly simplistic permissions management.

  • :add adds a user with a password
  • :delete deletes a user
  • :set_permissions sets the permissions for a user, vhost is optional
  • :clear_permissions clears the permissions for a user
  • :set_tags set the tags on a user
  • :clear_tags clear any tags on a user
  • :change_password set the password for a user

Examples

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 "joe" do
  tag "admin,lead"
  action :set_tags
end

vhost

Adds and deletes vhosts.

  • :add adds a vhost
  • :delete deletes a vhost

Examples

rabbitmq_vhost "/nova" do
  action :add
end

cluster

Join cluster, set cluster name and change cluster node type.

  • :join join in cluster as a manual clustering. node will join in first node of json string data.

    • cluster nodes data json format : Data should have all the cluster nodes information.
 [
     {
         "name" : "rabbit@rabbit1",
         "type" : "disc"
     },
     {
         "name" : "rabbit@rabbit2",
         "type" : "ram"
     },
     {
         "name" "rabbit@rabbit3",
         "type" : "disc"
     }
]
  • :set_cluster_name set the cluster name.
  • :change_cluster_node_type change cluster type of node. disc or ram should be set.

Examples

rabbitmq_cluster '[{"name":"rabbit@rabbit1","type":"disc"},{"name":"rabbit@rabbit2","type":"ram"},{"name":"rabbit@rabbit3","type":"disc"}]' do
  action :join
end
rabbitmq_cluster '[{"name":"rabbit@rabbit1","type":"disc"},{"name":"rabbit@rabbit2","type":"ram"},{"name":"rabbit@rabbit3","type":"disc"}]' do
  cluster_name 'seoul_tokyo_newyork'
  action :set_cluster_name
end
rabbitmq_cluster '[{"name":"rabbit@rabbit1","type":"disc"},{"name":"rabbit@rabbit2","type":"ram"},{"name":"rabbit@rabbit3","type":"disc"}]' do
  action :change_cluster_node_type
end

Limitations

For an already running cluster, these actions still require manual intervention:
- changing the :erlang_cookie
- turning :cluster from true to false

License & Authors

Copyright (c) 2009-2015, Chef Software, 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.

Dependent cookbooks

erlang ~> 1.5.0
yum-epel >= 0.0.0
yum-erlang_solutions >= 0.0.0

Contingent cookbooks

abiquo Applicable Versions
gitorious Applicable Versions
letsencrypt-boulder-server Applicable Versions
logstash Applicable Versions
openstack-ops-messaging Applicable Versions
phpstack Applicable Versions
pythonstack Applicable Versions
rabbitmq-cluster Applicable Versions
rabbitmq-management Applicable Versions
rabbitmq_settings Applicable Versions
sensu Applicable Versions
stack_commons Applicable Versions
stackstorm Applicable Versions
storj Applicable Versions
zenoss Applicable Versions

rabbitmq Cookbook CHANGELOG

This file is used to list changes made in each version of the rabbitmq cookbook.

v4.2.0 (2015-08-28)

  • Updated the CHANGELOG.md formatting
  • PR #295
  • PR #290
  • PR #294
  • PR #293
  • PR #292
  • PR #296
  • PR #297

v4.1.2 (2015-06-16)

  • Stupid Rubocop

v4.1.1 (2015-07-17)

  • Allow for flexiable SSL cipher formats #280
  • Use gsub instead of gsub! #284
  • Support rabbitmq_user with multiple vhosts. #279
  • Fix exception when first node is launched. Fixes issue #285 #286
  • Allow the service to be manually managed #281
  • Fix user_has_tag? issue when name and tag are the same #140

v4.0.1 (2015-06-16)

  • Fix single quote and nil issues with cluster recipe #274
  • Fixed 'rabbitmqctl eval' command for old rabbitmq versions #272
  • Support additional env args #269
  • Add patterns to catch where the node name is surrounded by single-quotes #267
  • Remove the extra curly braces for format_ssl_ciphers #260

v4.0.0 (2015-04-23)

v3.13.0 (2015-04-23)

  • Added ssl_ciphers #255
  • Fix plugin_enabled not having path appended #253
  • Add more support for erlang args #247
  • Open file limit not set correctly #127
  • Additional rabbit configs #217
  • Updated the erlang cookbook dependancy

v3.12.0 (2015-04-07)

  • Removed yum-epel case statement #236
  • don't put change password in log #237
  • Added pin_distro_version for other platforms #234
  • specifying ssl #152
  • additional debs and rpms #220
  • umask #219
  • typo fixed #243

v3.11.0 (2015-02-25)

  • Fix travis build. #228
  • Update Contributing file with new links and help. #229
  • Change module back to Opscode. #231
  • Update for 3.4.4 #223
  • Exclude CentOS 6/7 from distro version suite (no or broken upstream)

v3.10.0 (2015-02-05)

Song of this Release: First Person Shooter by Celldweller

  • Add more chefspec tests #193
  • initial enforcement of Gemfile.lock #213
  • add support for loopback users #212
  • CentOS 7 support #214
  • changed regex behavior for guard command on set user permission resource #215

v3.9.0 (2015-01-28)

Song of this Release: Cascade by Hyper

  • Moved the service enable and start to the bottom of the default recipe so you can change variables around. Issue #201
  • syntax typos #208
  • LWRP for managing RabbitMQ parameters #207
  • Distro version pinning #211

v3.8.0 (2015-01-07)

Song of this Release: Sunlight (2011) by by Modestep

  • Update to 3.4.3 release of rabbitmq
  • Updated from 12.04 to 14.04 for Ubuntu Specs

v3.7.0 (2014-12-18)

  • #185 Updated cloud kitchen.yml
  • #186 Updated chefspec for multiple oses
  • #180 Instead of defaulting to :upgrade we default to :install with the a pinned version number
  • #187 Updating Readme
  • #184 Supports setting rabbitmq config file to a different path

v3.6.0 (2014-12-9)

  • #161 Community plugins
  • #158 Adds policy apply_to option
  • #151 make config file template source cookbook configurable
  • #121 COOK-4694 Remove service restart for vhost mgmnt

v3.5.1 (2014-12-5)

  • #176 Chef-client 12 released and the PATH attribute was removed.

v3.5.0 (2014-12-2)

Song of this Release: 0 to 100/The Catchup by Drake

  • Updated for the new release of RabbitMQ release 3.4.2
  • Removed the Centos 5.10 from integration testing
  • Updated the Gemfile for testing
  • #87 expose the heartbeat configuration parameter
  • #168 Initial Chefspec
  • #166 Updated to 3.4.2 release
  • d1bfae8 Rubocop'd all the things
  • ccf42a3 Started to get Travis to be our gatekeeper
  • #172 Updates ['rabbitmq']['config'] to use ['rabbitmq']['config_root'] attribute
  • #123 Add raw configuration for rabbitmq.erb

v3.4.0 (2014-11-23)

  • Updated the RuboCop camel case
  • Make rabbitmq service restart immediately
  • Add sensitive flag for resources that expose passwords in log
  • Issue: #153
  • move serverspec v1 tests to use busser-rspec
  • Adding switch to make TCP listeners optional
  • Update user.rb
  • Update default.rb
  • Merge branch 'pr-128'
  • add serverspec tests for plugin lwrp
  • Plugin provider. fixes #141
  • Add test that fails if plugin notifications aren't working properly.

v3.3.0 (2014-08-28)

  • Bump default rabbitmq-server version to 3.3.5
  • [COOK-4641] - remove setsid calls in service resource
  • Testing updates
  • Minor documentation fix re: rabbitmq_policy usage

v3.2.2 (2014-05-07)

  • [COOK-2676] - Fixing startup issue when cluster mode is enabled

v3.2.0 (2014-04-23)

  • [COOK-4517] - Add cluster partition handling attribute to the cookbook

v3.1.0 (2014-03-27)

  • [COOK-4459] - added missing dependency package logrotate
  • [COOK-4279] - Addition of ssl_opts in rabbitmq.config when web_console_ssl is enabled

v3.0.4 (2014-03-19)

  • [COOK-4431] - RPM / DEB package installs now use the rabbit version you specify
  • [COOK-4438] - rabbitmq_policy resource breaks if you use rabbitmq version >= 3.2

v3.0.2 (2014-02-27)

  • [COOK-4384] Add ChefSpec Custom Matchers for LWRPs

v3.0.0 (2014-02-27)

[COOK-4369] - use_inline_resources

v2.4.2 (2014-02-27)

[COOK-4280] Upstart script properly waits until the server is started

v2.4.0 (2014-02-14)

  • [COOK-4050] - Do not force failure in rabbitmq_user
  • [COOK-4088] - Update rabbitmq.config for port ranges
  • Updating test harness. Fixing style cops

v2.3.2

Bug

  • COOK-3678 - Fix an issue where a RabbitMQ policy resource with vhost arguments emits unexpected restart notification
  • COOK-3606 - Fix erlang cookie comparison
  • COOK-3512 - Define rabbitmq service on SUSE

New Feature

  • COOK-3538 - Configure web management console to use SSL

v2.3.0

Improvement

  • COOK-3369 - Add SUSE support
  • COOK-3320 - Configure bind and cluster over a specified addr
  • COOK-3138 - Do not log RabbitMQ password
  • COOK-2803 - Bind erlang networking to localhost (attribute-driven)

v2.2.0

Improvement

  • Greatly expanded Test Kitchen coverage and platform support
  • added support for disabling policies and virtualhosts through attributes
  • added support for using with the erlang::esl recipe
  • [COOK-2705]: Add ability to change tcp_listen_options in config
  • [COOK-2397]: Added upstart support to rabbitmq cookbook
  • [COOK-2830]: Use a notify for server restart, instead of defining a new service
  • [COOK-3384]: Added ability to change user password
  • [COOK-3489]: Add attribute to set open file limit

Bug

  • [COOK-3011]: Incorrect apt source test causes Chef run to fail on Ubuntu
  • [COOK-3438]: RabbitMQ fixes for Fedora 19

v2.1.2

Improvement

  • [COOK-3099]: policy resource should support optional vhost argument

Bug

  • [COOK-3078]: rabbitmq password is not quoted or escaped on add_user
  • [COOK-3079]: rabbitmq permissions check doesn't match, resulting in non-idempotency

v2.1.0

Bug

  • [COOK-2828]: Rabbitmq Clustering doesn't work properly
  • [COOK-2975]: rabbitmq has foodcritic failures

New Feature

  • [COOK-2575]: LWRP for setting policies

v2.0.0

  • Major v2.0 changes are documented in the README.
  • [COOK-2391] - Added support for verify verify_peer and fail_if_no_peer_cert true
  • [COOK-2153] - Fix of user LWRP
  • [COOK-2180] - Plugin management via node attributes
  • [COOK-2201] - Use the proper syntax when using rabbitmq 3.0 instead of 2.x
  • [COOK-2210] - User management via node attributes
  • [COOK-2211] - Virtualhost management via node attributes
  • [COOK-2235] - RabbitMQ bin path isn't necessarily part of PATH for the plugin provider
  • [COOK-2392] - correctly configure a rabbitmq cluster
  • [COOK-2366] - Default recipe doesn't create mnesia dir
  • [COOK-2416] - Add support for clearing tags.

v1.8.0

  • [COOK-2151] - Add config options for disk_free_limit and vm_memory_high_watermark via attributes

v1.7.0

  • [COOK-1850] - oracle linux support
  • [COOK-1873] - add set_user_tag action to rabbitmq_user LWRP
  • [COOK-1878] - :immediately action causes clustering to fail
  • [COOK-1888] - smartos support

v1.6.4

  • [COOK-1684] - Unify behavior of debian and rhel clones in the rabbitmq cookbook
  • [COOK-1724] - enable using the distro release of rabbitmq instead of the RabbitMQ.org version

v1.6.2

  • [COOK-1552] - removed rogue single quote from rabbitmq ssl configuration

v1.6.0

  • [COOK-1496] - explicitly include the apt recipe
  • [COOK-1501] - Allow user to enable yum-based installation of rabbitmq via an attribute
  • [COOK-1503] - Recipe to enable rabbitmq web management console

v1.5.0

This version requires apt cookbook v1.4.4 (reflected in metadata).

  • [COOK-1216] - add amazon linux to RHELish platforms
  • [COOK-1217] - specify version, for RHELish platforms
  • [COOK-1219] - immediately restart service on config update
  • [COOK-1317] - fix installation of old version from ubuntu APT repo
  • [COOK-1331] - LWRP for enabling/disabling rabbitmq plugins
  • [COOK-1386] - increment rabbitmq version to 2.8.4
  • [COOK-1432] - resolve foodcritic warnings
  • [COOK-1438] - add fedora to RHELish platforms

v1.4.1

  • [COOK-1386] - Bumped version to 2.8.4
  • rabbitmq::default now includes erlang::default

v1.4.0

  • [COOK-911] - Auto clustering support

v1.3.2

  • [COOK-585] - manage rabbitmq-server service

Foodcritic Metric
            

4.2.1 failed this metric

FC023: Prefer conditional attributes: /tmp/cook/b4c4be6b66901448bcbf2b9b/rabbitmq/providers/plugin.rb:35
FC023: Prefer conditional attributes: /tmp/cook/b4c4be6b66901448bcbf2b9b/rabbitmq/providers/plugin.rb:46
FC023: Prefer conditional attributes: /tmp/cook/b4c4be6b66901448bcbf2b9b/rabbitmq/recipes/cluster.rb:29
FC023: Prefer conditional attributes: /tmp/cook/b4c4be6b66901448bcbf2b9b/rabbitmq/recipes/default.rb:149
FC031: Cookbook without metadata file: /tmp/cook/b4c4be6b66901448bcbf2b9b/rabbitmq/metadata.rb:1
FC045: Consider setting cookbook name in metadata: /tmp/cook/b4c4be6b66901448bcbf2b9b/rabbitmq/metadata.rb:1