From 6e1f697ba4d04386538804c89f36cfb81ee6d52e Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Tue, 11 Jul 2017 15:11:39 -0400 Subject: [PATCH] (#433) Reload Service[sensu_api] on RabbitMQ config changes Without this patch the Sensu API service doesn't reload itself when RabbitMQ configuration changes occur. This patch addresses the problem by adding a relationship between the rabbitmq configuration class and the service resource. Note, both sensu::rabbitmq::config and sensu::redis::config are in the catalog regardless of which is actually being configured. Resolves #433 --- manifests/api/service.pp | 1 + spec/classes/sensu_api_spec.rb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/manifests/api/service.pp b/manifests/api/service.pp index 2895091b18..db85f3d0cd 100644 --- a/manifests/api/service.pp +++ b/manifests/api/service.pp @@ -40,6 +40,7 @@ Class['sensu::package'], Class['sensu::api::config'], Class['sensu::redis::config'], + Class['sensu::rabbitmq::config'], ], } } diff --git a/spec/classes/sensu_api_spec.rb b/spec/classes/sensu_api_spec.rb index 60b0a6dd39..a5b80d96bc 100644 --- a/spec/classes/sensu_api_spec.rb +++ b/spec/classes/sensu_api_spec.rb @@ -162,6 +162,11 @@ :enable => true, :hasrestart => true )} + describe '(#433)' do + it { is_expected.to contain_service('sensu-api').that_subscribes_to('Class[sensu::redis::config]') } + # GH-433 Make sure the API subscribes to rabbitmq and redis + it { is_expected.to contain_service('sensu-api').that_subscribes_to('Class[sensu::rabbitmq::config]') } + end end # managing services context 'not managing services' do