|
|
|
@ -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 |
|
|
|
|
# instead of using db_sync |
|
|
|
|
barbican_config { 'DEFAULT/db_auto_create': value => $db_auto_create } |
|
|
|
@ -469,52 +460,60 @@ class barbican::api (
|
|
|
|
|
include barbican::db::sync |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if $service_name == 'barbican-api' or $service_name == $::barbican::params::api_service_name { |
|
|
|
|
|
|
|
|
|
if $::operatingsystem == 'Ubuntu' { |
|
|
|
|
fail('With Ubuntu packages the service_name must be set to httpd as there is no eventlet init script.') |
|
|
|
|
if $manage_service { |
|
|
|
|
if $enabled { |
|
|
|
|
$service_ensure = 'running' |
|
|
|
|
} else { |
|
|
|
|
$service_ensure = 'stopped' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if $::osfamily == 'RedHat' and $service_name == 'barbican-api' { |
|
|
|
|
warning('The usage of barbican-api as service_name in Red Hat based OS is \ |
|
|
|
|
deprecated and will be removed in a future release. Use openstack-barbican-api instead.') |
|
|
|
|
} |
|
|
|
|
if $service_name == 'barbican-api' or $service_name == $::barbican::params::api_service_name { |
|
|
|
|
|
|
|
|
|
service { 'barbican-api': |
|
|
|
|
ensure => $service_ensure, |
|
|
|
|
name => $::barbican::params::api_service_name, |
|
|
|
|
enable => $enabled, |
|
|
|
|
hasstatus => true, |
|
|
|
|
hasrestart => true, |
|
|
|
|
tag => 'barbican-service', |
|
|
|
|
} |
|
|
|
|
if $::operatingsystem == 'Ubuntu' { |
|
|
|
|
fail('With Ubuntu packages the service_name must be set to httpd as there is no eventlet init script.') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# Debian is using UWSGI, not gunicorn |
|
|
|
|
if $::operatingsystem != 'Debian' { |
|
|
|
|
file_line { 'Modify bind_port in gunicorn-config.py': |
|
|
|
|
path => '/etc/barbican/gunicorn-config.py', |
|
|
|
|
line => "bind = '${bind_host}:${bind_port}'", |
|
|
|
|
match => '.*bind = .*', |
|
|
|
|
tag => 'modify-bind-port', |
|
|
|
|
if $::osfamily == 'RedHat' and $service_name == 'barbican-api' { |
|
|
|
|
warning('The usage of barbican-api as service_name in Red Hat based OS is \ |
|
|
|
|
deprecated and will be removed in a future release. Use openstack-barbican-api instead.') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} elsif $service_name == 'httpd' { |
|
|
|
|
# Ubuntu packages does not have a barbican-api service |
|
|
|
|
if $::operatingsystem != 'Ubuntu' { |
|
|
|
|
service { 'barbican-api': |
|
|
|
|
ensure => 'stopped', |
|
|
|
|
name => $::barbican::params::api_service_name, |
|
|
|
|
enable => false, |
|
|
|
|
tag => 'barbican-service', |
|
|
|
|
ensure => $service_ensure, |
|
|
|
|
name => $::barbican::params::api_service_name, |
|
|
|
|
enable => $enabled, |
|
|
|
|
hasstatus => true, |
|
|
|
|
hasrestart => true, |
|
|
|
|
tag => 'barbican-service', |
|
|
|
|
} |
|
|
|
|
Service <| title == 'httpd' |> { tag +> 'barbican-service' } |
|
|
|
|
|
|
|
|
|
# we need to make sure barbican-api is stopped before trying to start apache |
|
|
|
|
Service['barbican-api'] -> Service[$service_name] |
|
|
|
|
# Debian is using UWSGI, not gunicorn |
|
|
|
|
if $::operatingsystem != 'Debian' { |
|
|
|
|
file_line { 'Modify bind_port in gunicorn-config.py': |
|
|
|
|
path => '/etc/barbican/gunicorn-config.py', |
|
|
|
|
line => "bind = '${bind_host}:${bind_port}'", |
|
|
|
|
match => '.*bind = .*', |
|
|
|
|
tag => 'modify-bind-port', |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} elsif $service_name == 'httpd' { |
|
|
|
|
# Ubuntu packages does not have a barbican-api service |
|
|
|
|
if $::operatingsystem != 'Ubuntu' { |
|
|
|
|
service { 'barbican-api': |
|
|
|
|
ensure => 'stopped', |
|
|
|
|
name => $::barbican::params::api_service_name, |
|
|
|
|
enable => false, |
|
|
|
|
tag => 'barbican-service', |
|
|
|
|
} |
|
|
|
|
Service <| title == 'httpd' |> { tag +> 'barbican-service' } |
|
|
|
|
|
|
|
|
|
# we need to make sure barbican-api is stopped before trying to start apache |
|
|
|
|
Service['barbican-api'] -> Service[$service_name] |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
fail('Invalid service_name. Use barbican-api for stand-alone or httpd') |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
fail('Invalid service_name. Use barbican-api for stand-alone or httpd') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
oslo::middleware { 'barbican_config': |
|
|
|
|