Files
puppet-barbican/manifests/retry_scheduler.pp
Takashi Kajinami 626681f04d CentOS: Install barbican-retry service
RDO now provides the package to launch the barbican-retry service[1].
This change ensures the package and the service are configured by
the corresponding class.

[1] https://review.rdoproject.org/r/c/openstack/barbican-distgit/+/40434

Change-Id: I134feadb75b397bc159a8fe9e3dbc87915339785
2023-02-26 15:14:03 +09:00

73 lines
2.0 KiB
Puppet

# == Class: barbican::retry_scheduler
#
# Class to configure the retry scheduler service
#
# === Parameters
#
# [*package_ensure*]
# (Optional) The state of the barbican-retry package.
# Defaults to 'present'
#
# [*manage_service*]
# (Optional) If we should manage the barbican-retry service.
# Defaults to true
#
# [*enabled*]
# (Optional) Whether to enable the barbican-retry service.
# Defaults to true
#
# [*initial_delay_seconds*]
# (optional) Seconds (float) to wait before starting retry scheduler
# Defaults to $::os_service_default
#
# [*periodic_interval_max_seconds*]
# (optional) Seconds (float) to wait between starting retry scheduler
# Defaults to $::os_service_default
#
class barbican::retry_scheduler (
$package_ensure = 'present',
$manage_service = true,
$enabled = true,
$initial_delay_seconds = $::os_service_default,
$periodic_interval_max_seconds = $::os_service_default,
){
include barbican::deps
include barbican::params
barbican_config {
'retry_scheduler/initial_delay_seconds': value => $initial_delay_seconds;
'retry_scheduler/periodic_interval_max_seconds': value => $periodic_interval_max_seconds;
}
case $::osfamily {
'RedHat': {
package { 'barbican-retry':
ensure => $package_ensure,
name => $::barbican::params::retry_package_name,
tag => ['openstack', 'barbican-package'],
}
if $manage_service {
if $enabled {
$service_ensure = 'running'
} else {
$service_ensure = 'stopped'
}
service { 'barbican-retry':
ensure => $service_ensure,
name => $::barbican::params::retry_service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,
tag => 'barbican-service',
}
}
}
default: {
warning('barbican-retry package/service is not available')
}
}
}