Merge "Deprecate rabbitmq connection parameters"

This commit is contained in:
Jenkins
2016-11-08 20:32:51 +00:00
committed by Gerrit Code Review
3 changed files with 59 additions and 29 deletions

View File

@@ -41,28 +41,9 @@
# zmq (for zeromq)
# Defaults to $::os_service_default
#
# [*rabbit_host*]
# (optional) Location of rabbitmq installation.
# Defaults to $::os_service_default
#
# [*rabbit_hosts*]
# (optional) List of clustered rabbit servers.
# Defaults to $::os_service_default
#
# [*rabbit_port*]
# (optional) Port for rabbitmq instance.
# Defaults to $::os_service_default
#
# [*rabbit_password*]
# (optional) Password used to connect to rabbitmq.
# Defaults to $::os_service_default
#
# [*rabbit_userid*]
# (optional) User used to connect to rabbitmq.
# Defaults to $::os_service_default
#
# [*rabbit_virtual_host*]
# (optional) The RabbitMQ virtual host.
# [*default_transport_url*]
# (optional) Connection url for oslo messaging backend. An example rabbit url
# would be, rabbit://user:pass@host:port/virtual_host
# Defaults to $::os_service_default
#
# [*rabbit_use_ssl*]
@@ -235,6 +216,30 @@
# (optional) DEPRECATED. Use auth_strategy instead.
# Defaults to undef
#
# [*rabbit_host*]
# (optional) Location of rabbitmq installation.
# Defaults to $::os_service_default
#
# [*rabbit_hosts*]
# (optional) List of clustered rabbit servers.
# Defaults to $::os_service_default
#
# [*rabbit_port*]
# (optional) Port for rabbitmq instance.
# Defaults to $::os_service_default
#
# [*rabbit_password*]
# (optional) Password used to connect to rabbitmq.
# Defaults to $::os_service_default
#
# [*rabbit_userid*]
# (optional) User used to connect to rabbitmq.
# Defaults to $::os_service_default
#
# [*rabbit_virtual_host*]
# (optional) The RabbitMQ virtual host.
# Defaults to $::os_service_default
#
class barbican::api (
$ensure_package = 'present',
$client_package_ensure = 'present',
@@ -244,12 +249,7 @@ class barbican::api (
$max_allowed_secret_in_bytes = $::os_service_default,
$max_allowed_request_size_in_bytes = $::os_service_default,
$rpc_backend = $::os_service_default,
$rabbit_host = $::os_service_default,
$rabbit_hosts = $::os_service_default,
$rabbit_password = $::os_service_default,
$rabbit_port = $::os_service_default,
$rabbit_userid = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
$default_transport_url = $::os_service_default,
$rabbit_use_ssl = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = $::os_service_default,
$rabbit_heartbeat_rate = $::os_service_default,
@@ -287,6 +287,12 @@ class barbican::api (
$auth_type = undef,
$keystone_password = undef,
$auth_url = undef,
$rabbit_host = $::os_service_default,
$rabbit_hosts = $::os_service_default,
$rabbit_password = $::os_service_default,
$rabbit_port = $::os_service_default,
$rabbit_userid = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
) inherits barbican::params {
@@ -309,6 +315,17 @@ class barbican::api (
warning('auth_url is deprecated, use barbican::keystone::authtoken::auth_url instead.')
}
if !is_service_default($rabbit_host) or
!is_service_default($rabbit_hosts) or
!is_service_default($rabbit_password) or
!is_service_default($rabbit_port) or
!is_service_default($rabbit_userid) or
!is_service_default($rabbit_virtual_host) {
warning("barbican::rabbit_host, barbican::rabbit_hosts, barbican::rabbit_password, \
barbican::rabbit_port, barbican::rabbit_userid and barbican::rabbit_virtual_host are \
deprecated. Please use barbican::default_transport_url instead.")
}
# TODO: Remove the posix users and permissions and merge this definition
# with the previous one, once the barbican package has been updated
# with the correct ownership for this directory.
@@ -371,6 +388,10 @@ class barbican::api (
barbican_config { 'DEFAULT/rpc_backend': value => $rpc_backend }
}
oslo::messaging::default { 'barbican_config':
transport_url => $default_transport_url,
}
# queue options
barbican_config {
'queue/enable': value => $enable_queue;

View File

@@ -0,0 +1,6 @@
---
deprecations:
- barbican::rabbit_host, barbican::rabbit_hosts, barbican::rabbit_password,
barbican::rabbit_port, barbican::rabbit_userid and
barbican::rabbit_virtual_host are deprecated.
barbican::default_transport_url should be used instead.

View File

@@ -28,6 +28,7 @@ describe 'barbican::api' do
:bind_host => '0.0.0.0',
:bind_port => '9311',
:rpc_backend => 'rabbit',
:default_transport_url => '<SERVICE DEFAULT>',
:rabbit_host => '<SERVICE_DEFAULT>',
:rabbit_hosts => ['<SERVICE DEFAULT>'],
:rabbit_password => '<SERVICE DEFAULT>',
@@ -69,6 +70,7 @@ describe 'barbican::api' do
:bind_host => '127.0.0.1',
:bind_port => '9312',
:rpc_backend => 'rabbit',
:default_transport_url => 'rabbit://bugs:bugs_bunny@localhost:1234/rabbithost',
:rabbit_host => 'rabbithost',
:rabbit_hosts => ['rabbithost:1234'],
:rabbit_password => 'bugs_bunny',
@@ -149,6 +151,7 @@ describe 'barbican::api' do
it 'configures rabbit' do
is_expected.to contain_barbican_config('DEFAULT/rpc_backend').with_value(param_hash[:rpc_backend])
is_expected.to contain_barbican_config('DEFAULT/transport_url').with_value(param_hash[:default_transport_url])
is_expected.to contain_barbican_config('oslo_messaging_rabbit/rabbit_hosts').with_value(param_hash[:rabbit_hosts])
is_expected.to contain_barbican_config('oslo_messaging_rabbit/rabbit_password').with_value(param_hash[:rabbit_password]).with_secret(true)
is_expected.to contain_barbican_config('oslo_messaging_rabbit/rabbit_userid').with_value(param_hash[:rabbit_userid])
@@ -323,7 +326,7 @@ describe 'barbican::api' do
case facts[:osfamily]
when 'RedHat'
let (:platform_params) do
{ :service_name => 'barbican-api' }
{ :service_name => 'barbican-api' }
end
it_behaves_like 'barbican api redhat'
when 'Debian'