Add a temp workaround for an issue #153 in rabbit cookbook

After configuring rabbitmq, restart the service to make configuration
take effect. So during OpenStack deployment, OpenStack services can
connect to rabbitmq successfully.
This workaround will notify rabbitmq-server to restart immediately.
This could be remove once the issue #153 is fixed in rabbit cookbook.

Change-Id: Ib017226f46c7e26429bb26df5b63525e1a98bc82
Closes-Bug: #1380940
This commit is contained in:
wenchma 2014-10-14 16:40:55 +08:00
parent 0b087d93f3
commit 4a0b9cf241
3 changed files with 16 additions and 0 deletions

View File

@ -7,6 +7,8 @@ This file is used to list changes made in each version of cookbook-openstack-ops
* Fix metadata version constraint for common
* Bump Chef gem to 11.16
* No need to push our rabbit user/password to rabbit cookbook
* Add a temp workaround for an issue #153 in rabbit cookbook to notify
rabbitmq-server to restart immediately.
## 10.0.0
* Upgrading to Juno

View File

@ -100,3 +100,9 @@ rabbitmq_user 'set rabbit administrator tag' do
action :set_tags
end
# TODO(wenchma) This could be removed once the issue is fixed in rabbitmq cookbook.
# Issue: https://github.com/kennonkwok/rabbitmq/issues/153
# Notifies rabbitmq-server service restart.
r = resources(template: "#{node['rabbitmq']['config_root']}/rabbitmq.config")
r.notifies(:restart, "service[#{node['rabbitmq']['service_name']}]", :immediately)

View File

@ -124,6 +124,14 @@ describe 'openstack-ops-messaging::rabbitmq-server' do
'set rabbit administrator tag'
).with(user: 'not-a-guest', tag: 'administrator')
end
describe 'notifies immediately' do
let(:template) { chef_run.template('/etc/rabbitmq/rabbitmq.config') }
it 'sends the specific notification to the service immediately' do
expect(template).to notify('service[rabbitmq-server]').to(:restart).immediately
end
end
end
end
end