diff --git a/CHANGELOG.md b/CHANGELOG.md index 110792c..3d7ca24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This file is used to list changes made in each version of cookbook-openstack-ops * 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. +* Add another workaround for the issue #153 in rabbit cookbook. ## 10.0.0 * Upgrading to Juno diff --git a/recipes/rabbitmq-server.rb b/recipes/rabbitmq-server.rb index e5d908e..af15f29 100644 --- a/recipes/rabbitmq-server.rb +++ b/recipes/rabbitmq-server.rb @@ -104,5 +104,7 @@ 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-env.conf") +r.notifies(:restart, "service[#{node['rabbitmq']['service_name']}]", :immediately) r = resources(template: "#{node['rabbitmq']['config_root']}/rabbitmq.config") r.notifies(:restart, "service[#{node['rabbitmq']['service_name']}]", :immediately) diff --git a/spec/rabbitmq-server_spec.rb b/spec/rabbitmq-server_spec.rb index 2140ea2..045786e 100644 --- a/spec/rabbitmq-server_spec.rb +++ b/spec/rabbitmq-server_spec.rb @@ -125,6 +125,14 @@ describe 'openstack-ops-messaging::rabbitmq-server' do ).with(user: 'not-a-guest', tag: 'administrator') end + describe 'template rabbitmq-env.conf notifies immediately' do + let(:template) { chef_run.template('/etc/rabbitmq/rabbitmq-env.conf') } + + it 'sends the specific notification to the service immediately' do + expect(template).to notify('service[rabbitmq-server]').to(:restart).immediately + end + end + describe 'notifies immediately' do let(:template) { chef_run.template('/etc/rabbitmq/rabbitmq.config') }