puppet-aodh/manifests/notifier.pp
Emilien Macchi 6e30e9f410 Implement Notifier service
* Manifest
* Unit tests
* Acceptance tests
* Example manifest

Change-Id: Ib0b82245fa9ffeb2c23bd26e2e7f3db6a0b6fe41
2015-11-03 15:47:56 +00:00

49 lines
1.1 KiB
Puppet

# Installs the aodh notifier service
#
# == Params
# [*enabled*]
# (optional) Should the service be enabled.
# Defaults to true.
#
# [*manage_service*]
# (optional) Whether the service should be managed by Puppet.
# Defaults to true.
#
# [*package_ensure*]
# (optional) ensure state for package.
# Defaults to 'present'
#
class aodh::notifier (
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
) {
include ::aodh::params
Aodh_config<||> ~> Service['aodh-notifier']
Package[$::aodh::params::notifier_package_name] -> Service['aodh-notifier']
ensure_resource( 'package', [$::aodh::params::notifier_package_name],
{ ensure => $package_ensure }
)
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
}
Package['aodh'] -> Service['aodh-notifier']
service { 'aodh-notifier':
ensure => $service_ensure,
name => $::aodh::params::notifier_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => 'aodh-service',
}
}