Do not define service resource when service management is disabled
Change-Id: If8f1baacf56cc5a78032a72c8b24f1db487feb58
This commit is contained in:
parent
685301e737
commit
9b0d38b342
@ -436,15 +436,6 @@ class barbican::api (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if $manage_service {
|
|
||||||
if $enabled {
|
|
||||||
$service_ensure = 'running'
|
|
||||||
} else {
|
|
||||||
$service_ensure = 'stopped'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# set value to have the server auto-create the database on startup
|
# set value to have the server auto-create the database on startup
|
||||||
# instead of using db_sync
|
# instead of using db_sync
|
||||||
barbican_config { 'DEFAULT/db_auto_create': value => $db_auto_create }
|
barbican_config { 'DEFAULT/db_auto_create': value => $db_auto_create }
|
||||||
@ -469,6 +460,13 @@ class barbican::api (
|
|||||||
include barbican::db::sync
|
include barbican::db::sync
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $manage_service {
|
||||||
|
if $enabled {
|
||||||
|
$service_ensure = 'running'
|
||||||
|
} else {
|
||||||
|
$service_ensure = 'stopped'
|
||||||
|
}
|
||||||
|
|
||||||
if $service_name == 'barbican-api' or $service_name == $::barbican::params::api_service_name {
|
if $service_name == 'barbican-api' or $service_name == $::barbican::params::api_service_name {
|
||||||
|
|
||||||
if $::operatingsystem == 'Ubuntu' {
|
if $::operatingsystem == 'Ubuntu' {
|
||||||
@ -516,6 +514,7 @@ deprecated and will be removed in a future release. Use openstack-barbican-api i
|
|||||||
} else {
|
} else {
|
||||||
fail('Invalid service_name. Use barbican-api for stand-alone or httpd')
|
fail('Invalid service_name. Use barbican-api for stand-alone or httpd')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
oslo::middleware { 'barbican_config':
|
oslo::middleware { 'barbican_config':
|
||||||
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
|
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
|
||||||
|
@ -339,17 +339,10 @@ describe 'barbican::api' do
|
|||||||
{
|
{
|
||||||
:manage_service => false,
|
:manage_service => false,
|
||||||
:enabled => false,
|
:enabled => false,
|
||||||
:auth_strategy => 'keystone',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_service('barbican-api').with(
|
it { is_expected.to_not contain_service('barbican-api') }
|
||||||
'ensure' => nil,
|
|
||||||
'enable' => false,
|
|
||||||
'hasstatus' => true,
|
|
||||||
'hasrestart' => true,
|
|
||||||
'tag' => 'barbican-service',
|
|
||||||
)}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user