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
This commit is contained in:
parent
0480d0a292
commit
626681f04d
@ -19,6 +19,8 @@ class barbican::params {
|
||||
$worker_service_name = 'openstack-barbican-worker'
|
||||
$keystone_listener_package_name = 'openstack-barbican-keystone-listener'
|
||||
$keystone_listener_service_name = 'openstack-barbican-keystone-listener'
|
||||
$retry_package_name = 'openstack-barbican-retry'
|
||||
$retry_service_name = 'openstack-barbican-retry'
|
||||
$barbican_wsgi_script_path = '/var/www/cgi-bin/barbican'
|
||||
$barbican_wsgi_script_source = '/usr/bin/barbican-wsgi-api'
|
||||
}
|
||||
@ -30,6 +32,8 @@ class barbican::params {
|
||||
$worker_service_name = 'barbican-worker'
|
||||
$keystone_listener_package_name = 'barbican-keystone-listener'
|
||||
$keystone_listener_service_name = 'barbican-keystone-listener'
|
||||
$retry_package_name = false
|
||||
$retry_service_name = false
|
||||
$barbican_wsgi_script_path = '/usr/lib/cgi-bin/barbican'
|
||||
$barbican_wsgi_script_source = '/usr/bin/barbican-wsgi-api'
|
||||
}
|
||||
|
@ -4,6 +4,18 @@
|
||||
#
|
||||
# === 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
|
||||
@ -13,10 +25,14 @@
|
||||
# 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 {
|
||||
@ -24,7 +40,33 @@ class barbican::retry_scheduler (
|
||||
'retry_scheduler/periodic_interval_max_seconds': value => $periodic_interval_max_seconds;
|
||||
}
|
||||
|
||||
# TODO(tkajinam): Currently NO DISTRO provides the package to install
|
||||
# the retry daemon service. Once that is fixed, install
|
||||
# a separate package and enable the service.
|
||||
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')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The ``barbican::retry_scheduler`` class now manages the package and
|
||||
the service to set up the ``barbican-retry`` service in CentOS and RHEL.
|
@ -31,15 +31,51 @@ describe 'barbican::retry_scheduler' do
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples 'barbican::retry_scheduler in RedHat' do
|
||||
it 'installs barbican-retry package' do
|
||||
is_expected.to contain_package('barbican-retry').with(
|
||||
:ensure => 'present',
|
||||
:name => platform_params[:retry_package_name],
|
||||
:tag => ['openstack', 'barbican-package']
|
||||
)
|
||||
end
|
||||
|
||||
it 'configures barbican-retry service' do
|
||||
is_expected.to contain_service('barbican-retry').with(
|
||||
:ensure => 'running',
|
||||
:name => platform_params[:retry_service_name],
|
||||
:enable => true,
|
||||
:hasstatus => true,
|
||||
:hasrestart => true,
|
||||
:tag => 'barbican-service'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
let (:facts) do
|
||||
facts.merge(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
let(:platform_params) do
|
||||
case facts[:osfamily]
|
||||
when 'Debian'
|
||||
{}
|
||||
when 'RedHat'
|
||||
{
|
||||
:retry_package_name => 'openstack-barbican-retry',
|
||||
:retry_service_name => 'openstack-barbican-retry'
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'barbican::retry_scheduler'
|
||||
if facts[:osfamily] == 'RedHat'
|
||||
it_behaves_like 'barbican::retry_scheduler in RedHat'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user