puppet-aodh/manifests/notifier.pp
Takashi Kajinami ae9b91107d Add support for workers option
This change introduces support for workers option of aodh services
(evaluator, listener, notifier) so that operators can define number
of processes used in each service.

Change-Id: Id64fc407d19aa546512078f67df3a727fd9f5525
2021-01-18 12:57:33 +09:00

56 lines
1.2 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'
#
# [*workers*]
# (optional) Number of workers for notifier service.
# Defaults to $::os_workers.
#
class aodh::notifier (
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$workers = $::os_workers,
) {
include aodh::deps
include aodh::params
aodh_config {
'notifier/workers': value => $workers;
}
ensure_resource( 'package', [$::aodh::params::notifier_package_name],
{ ensure => $package_ensure,
tag => ['openstack', 'aodh-package'] }
)
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
service { 'aodh-notifier':
ensure => $service_ensure,
name => $::aodh::params::notifier_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => 'aodh-service',
}
}
}