Skip to content

Commit

Permalink
Merge pull request #18 from sensu/enterprise-reload
Browse files Browse the repository at this point in the history
Use reload of sensu-enterprise service rather than restart
  • Loading branch information
ghoneycutt authored Aug 20, 2019
2 parents 8992cab + 88af9d1 commit a9f4449
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions manifests/enterprise.pp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@
Class['sensuclassic::package'],
],
}

exec { 'sensu-enterprise-reload':
path => '/usr/bin:/bin:/usr/sbin:/sbin',
command => 'service sensu-enterprise reload',
refreshonly => true,
require => Service['sensu-enterprise'],
}
}
}
}
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@
}

if $enterprise and $manage_services {
$enterprise_service = Service['sensu-enterprise']
$enterprise_service = Exec['sensu-enterprise-reload']
} else {
$enterprise_service = undef
}
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/sensuclassic_enterprise_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
it { should contain_service('sensu-enterprise').that_subscribes_to('Class[sensuclassic::redis::config]') }
it { should contain_service('sensu-enterprise').that_subscribes_to('Class[sensuclassic::rabbitmq::config]') }
it { should contain_service('sensu-enterprise').that_subscribes_to('Class[sensuclassic::package]') }
it { should contain_exec('sensu-enterprise-reload').with_command('service sensu-enterprise reload') }
it { should_not contain_yumrepo('sensu-enterprise-dashboard') }
it { should contain_package('sensu-enterprise') }

Expand Down Expand Up @@ -249,6 +250,7 @@
} }
it { should contain_yumrepo('sensu-enterprise') }
it { should contain_service('sensu-enterprise') }
it { should contain_exec('sensu-enterprise-reload') }
it { should_not contain_yumrepo('sensu-enterprise-dashboard') }
it { should_not contain_service('sensu-enterprise-dashboard') }
end
Expand Down
5 changes: 5 additions & 0 deletions spec/defines/sensuclassic_check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@
let(:pre_condition) { 'class {"sensuclassic": client => true, api => true, server => true}' }
it { should contain_sensuclassic__write_json(fpath).with(:notify_list => ['Service[sensu-client]', 'Class[Sensuclassic::Server::Service]', 'Service[sensu-api]']) }
end

context 'client and enterprise' do
let(:pre_condition) { 'class {"sensuclassic": enterprise => true, enterprise_user => "sensu", enterprise_pass => "sensu"}' }
it { should contain_sensuclassic__write_json(fpath).with(:notify_list => ['Service[sensu-client]', 'Exec[sensu-enterprise-reload]']) }
end
end

context 'with subdue' do
Expand Down

0 comments on commit a9f4449

Please sign in to comment.