Debian: fix barbican-api setup

Currently, it's not possible to use eventlet in Debian because the test
has been made on $::osfamily == 'Debian' instead of $::os_package_type.

Also, in Debian, the barbican-api service was never stopped before
configuring Apache, therefore, starting Apache just failed.

This patch also adds the $::barbican::params::api_service_name var if
using Debian packages.

Change-Id: Ide559f8fdc58ed3539325acd6696cec23c3de65b
This commit is contained in:
Thomas Goirand 2018-05-08 17:24:35 +02:00 committed by Tobias Urdin
parent 641d9b6772
commit dea80f2eb9
2 changed files with 7 additions and 4 deletions

View File

@ -510,8 +510,8 @@ barbican::rpc_backend are deprecated. Please use barbican::api::default_transpor
}
if $service_name == 'barbican-api' {
if $::osfamily == 'Debian' {
fail('On Debian family the service_name must be set to httpd as there is no eventlet init script.')
if $::os_package_type == 'ubuntu' {
fail('With Ubuntu packages the service_name must be set to httpd as there is no eventlet init script.')
}
service { 'barbican-api':
ensure => $service_ensure,
@ -531,8 +531,8 @@ barbican::rpc_backend are deprecated. Please use barbican::api::default_transpor
} elsif $service_name == 'httpd' {
include ::apache::params
# Debian/Ubuntu do not have a barbican-api and this will error out on them.
if $::osfamily == 'RedHat' {
# Ubuntu packages does not have a barbican-api service
if $::os_package_type != 'ubuntu' {
service { 'barbican-api':
ensure => 'stopped',
name => $::barbican::params::api_service_name,

View File

@ -26,6 +26,9 @@ class barbican::params {
$httpd_config_file = '/etc/httpd/conf.d/barbican-api.conf'
}
'Debian': {
if ($::os_package_type == 'debian') {
$api_service_name = 'barbican-api'
}
$api_package_name = 'barbican-api'
$worker_package_name = 'barbican-worker'
$worker_service_name = 'barbican-worker'