Skip to content

Commit

Permalink
Merge pull request #257 from jjasghar/major_release
Browse files Browse the repository at this point in the history
4.0.0 release
  • Loading branch information
JJ Asghar committed Apr 24, 2015
2 parents 1b782cc + 4e45c2d commit 8aa251c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ rabbitmq Cookbook CHANGELOG
===========================
This file is used to list changes made in each version of the rabbitmq cookbook.

v4.0.0 (2015-04-23)
--------------------
- added #238 for clustering depreciating the [rabbitmq-cluster cookbook](https://supermarket.chef.io/cookbooks/rabbitmq-cluster)
- added #245 for expected Debian family usage

v3.13.0 (2015-04-23)
--------------------
- Added ssl_ciphers #255
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Configure the cluster between the nodes in the `node['rabbitmq']['clustering']['
* `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_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
Expand Down Expand Up @@ -207,7 +207,7 @@ 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.

```
[
{
Expand Down Expand Up @@ -265,8 +265,7 @@ For an already running cluster, these actions still require manual intervention:
- Author:: JJ Asghar (<jj@chef.io>)

```text
Copyright (c) 2009-2013, Chef Software, Inc.
Copyright (c) 2014-2015, Chef Software, Inc.
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.
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
maintainer_email 'jj@chef.io'
license 'Apache 2.0'
description 'Installs and configures RabbitMQ server'
version '3.13.0'
version '4.0.0'
recipe 'rabbitmq', 'Install and configure RabbitMQ'
recipe 'rabbitmq::cluster', 'Set up RabbitMQ clustering.'
recipe 'rabbitmq::plugin_management', 'Manage plugins with node attributes'
Expand Down
9 changes: 8 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ class Chef::Resource # rubocop:disable all
recursive true
end

template "#{node['rabbitmq']['config_root']}/rabbitmq-env.conf" do
source 'rabbitmq-env.conf.erb'
owner 'root'
group 'root'
mode 00644
notifies :restart, "service[#{node['rabbitmq']['service_name']}]", :immediately
end

template "#{node['rabbitmq']['config']}.config" do
sensitive true
source 'rabbitmq.config.erb'
Expand All @@ -169,7 +177,6 @@ class Chef::Resource # rubocop:disable all
notifies :restart, "service[#{node['rabbitmq']['service_name']}]", :immediately
end


template "/etc/default/#{node['rabbitmq']['service_name']}" do
source 'default.rabbitmq-server.erb'
owner 'root'
Expand Down
33 changes: 24 additions & 9 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@

include_context 'rabbitmq-stubs'

it 'should autostart via the exit 101' do
expect(chef_run).to run_execute('disable auto-start 1/2')
end

it 'should disable the autostart 2/2' do
expect(chef_run).to run_execute('disable auto-start 2/2')
end

it 'should install the logrotate package' do
expect(chef_run).to install_package('logrotate')
end
Expand All @@ -149,6 +157,18 @@
expect(chef_run).to install_dpkg_package('/tmp/rabbitmq-server_3.4.4-1_all.deb')
end

it 'creates a template rabbitmq-server with attributes' do
expect(chef_run).to create_template('/etc/default/rabbitmq-server').with(
:user => 'root',
:group => 'root',
:source => 'default.rabbitmq-server.erb',
:mode => 00644)
end

it 'should undo the service disable hack' do
expect(chef_run).to run_execute('undo service disable hack')
end

describe 'uses distro version' do
before do
node.set['rabbitmq']['use_distro_version'] = true
Expand Down Expand Up @@ -228,6 +248,10 @@
expect(chef_run).to_not install_rpm_package('/tmp/not-rabbitmq-server-3.4.4-1.noarch.rpm')
end

it 'includes the `yum-epel` recipe' do
expect(chef_run).to include_recipe('yum-epel')
end

describe 'uses distro version' do
before do
node.set['rabbitmq']['use_distro_version'] = true
Expand Down Expand Up @@ -267,13 +291,4 @@
end
end
end

it 'creates a template rabbitmq.config with attributes' do
expect(chef_run).to create_template('/etc/rabbitmq/rabbitmq.config').with(
:user => 'root',
:group => 'root',
:source => 'rabbitmq.config.erb',
:mode => 00644
)
end
end

0 comments on commit 8aa251c

Please sign in to comment.