Remove rpc_backend conditional for oslo.messaging driver options
Oslo.messaging uses the transport_url to represent the rpc and notification messaging driver to use and its full configuration. The rpc_backend configuration option is deprecated for removal and should not gate oslo.messaging driver configuration options. This patch: * deprecate rpc_backend * remove conditional check * update spec tests * add release note Change-Id: Id779b3cc169bee0d30ae16b37a6e03004b2e0dcc
This commit is contained in:
parent
4954b5e626
commit
c194351429
@ -29,13 +29,6 @@
|
||||
# option.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rpc_backend*]
|
||||
# (optional) The rpc backend implementation to use, can be:
|
||||
# amqp (for AMQP 1.0 protocol)
|
||||
# rabbit (for rabbitmq)
|
||||
# zmq (for zeromq)
|
||||
# Defaults to 'rabbit'
|
||||
#
|
||||
# [*rabbit_use_ssl*]
|
||||
# (optional) Connect over SSL for RabbitMQ
|
||||
# Defaults to $::os_service_default
|
||||
@ -264,13 +257,19 @@
|
||||
# (optional) The state of aodh packages
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*rpc_backend*]
|
||||
# (optional) The rpc backend implementation to use, can be:
|
||||
# amqp (for AMQP 1.0 protocol)
|
||||
# rabbit (for rabbitmq)
|
||||
# zmq (for zeromq)
|
||||
# Defaults to 'rabbit'
|
||||
#
|
||||
class aodh (
|
||||
$package_ensure = 'present',
|
||||
$alarm_history_time_to_live = $::os_service_default,
|
||||
$default_transport_url = $::os_service_default,
|
||||
$rpc_response_timeout = $::os_service_default,
|
||||
$control_exchange = $::os_service_default,
|
||||
$rpc_backend = 'rabbit',
|
||||
$rabbit_use_ssl = $::os_service_default,
|
||||
$rabbit_heartbeat_timeout_threshold = $::os_service_default,
|
||||
$rabbit_heartbeat_rate = $::os_service_default,
|
||||
@ -324,6 +323,7 @@ class aodh (
|
||||
$rabbit_userid = $::os_service_default,
|
||||
$rabbit_virtual_host = $::os_service_default,
|
||||
$ensure_package = undef,
|
||||
$rpc_backend = 'rabbit',
|
||||
) inherits aodh::params {
|
||||
|
||||
include ::aodh::deps
|
||||
@ -335,10 +335,12 @@ class aodh (
|
||||
!is_service_default($rabbit_password) or
|
||||
!is_service_default($rabbit_port) or
|
||||
!is_service_default($rabbit_userid) or
|
||||
!is_service_default($rabbit_virtual_host) {
|
||||
!is_service_default($rabbit_virtual_host) or
|
||||
!is_service_default($rpc_backend) {
|
||||
warning("aodh::rabbit_host, aodh::rabbit_hosts, aodh::rabbit_password, \
|
||||
aodh::rabbit_port, aodh::rabbit_userid and aodh::rabbit_virtual_host are \
|
||||
deprecated. Please use aodh::default_transport_url instead.")
|
||||
aodh::rabbit_port, aodh::rabbit_userid, aodh::rabbit_virtual_host and \
|
||||
aodh::rpc_backend are deprecated. Please use aodh::default_transport_url \
|
||||
instead.")
|
||||
}
|
||||
|
||||
if $ensure_package {
|
||||
@ -359,46 +361,43 @@ the future release. Please use aodh::package_ensure instead.")
|
||||
purge => $purge_config,
|
||||
}
|
||||
|
||||
if $rpc_backend == 'rabbit' {
|
||||
oslo::messaging::rabbit { 'aodh_config':
|
||||
rabbit_userid => $rabbit_userid,
|
||||
rabbit_password => $rabbit_password,
|
||||
rabbit_virtual_host => $rabbit_virtual_host,
|
||||
rabbit_host => $rabbit_host,
|
||||
rabbit_port => $rabbit_port,
|
||||
rabbit_hosts => $rabbit_hosts,
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
|
||||
heartbeat_rate => $rabbit_heartbeat_rate,
|
||||
rabbit_use_ssl => $rabbit_use_ssl,
|
||||
kombu_reconnect_delay => $kombu_reconnect_delay,
|
||||
kombu_ssl_version => $kombu_ssl_version,
|
||||
kombu_ssl_keyfile => $kombu_ssl_keyfile,
|
||||
kombu_ssl_certfile => $kombu_ssl_certfile,
|
||||
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
|
||||
kombu_compression => $kombu_compression,
|
||||
amqp_durable_queues => $amqp_durable_queues,
|
||||
}
|
||||
oslo::messaging::rabbit { 'aodh_config':
|
||||
rabbit_userid => $rabbit_userid,
|
||||
rabbit_password => $rabbit_password,
|
||||
rabbit_virtual_host => $rabbit_virtual_host,
|
||||
rabbit_host => $rabbit_host,
|
||||
rabbit_port => $rabbit_port,
|
||||
rabbit_hosts => $rabbit_hosts,
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
|
||||
heartbeat_rate => $rabbit_heartbeat_rate,
|
||||
rabbit_use_ssl => $rabbit_use_ssl,
|
||||
kombu_reconnect_delay => $kombu_reconnect_delay,
|
||||
kombu_ssl_version => $kombu_ssl_version,
|
||||
kombu_ssl_keyfile => $kombu_ssl_keyfile,
|
||||
kombu_ssl_certfile => $kombu_ssl_certfile,
|
||||
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
|
||||
kombu_compression => $kombu_compression,
|
||||
amqp_durable_queues => $amqp_durable_queues,
|
||||
}
|
||||
elsif $rpc_backend == 'amqp' {
|
||||
oslo::messaging::amqp { 'aodh_config':
|
||||
server_request_prefix => $amqp_server_request_prefix,
|
||||
broadcast_prefix => $amqp_broadcast_prefix,
|
||||
group_request_prefix => $amqp_group_request_prefix,
|
||||
container_name => $amqp_container_name,
|
||||
idle_timeout => $amqp_idle_timeout,
|
||||
trace => $amqp_trace,
|
||||
ssl_ca_file => $amqp_ssl_ca_file,
|
||||
ssl_cert_file => $amqp_ssl_cert_file,
|
||||
ssl_key_file => $amqp_ssl_key_file,
|
||||
ssl_key_password => $amqp_ssl_key_password,
|
||||
allow_insecure_clients => $amqp_allow_insecure_clients,
|
||||
sasl_mechanisms => $amqp_sasl_mechanisms,
|
||||
sasl_config_dir => $amqp_sasl_config_dir,
|
||||
sasl_config_name => $amqp_sasl_config_name,
|
||||
username => $amqp_username,
|
||||
password => $amqp_password,
|
||||
}
|
||||
|
||||
oslo::messaging::amqp { 'aodh_config':
|
||||
server_request_prefix => $amqp_server_request_prefix,
|
||||
broadcast_prefix => $amqp_broadcast_prefix,
|
||||
group_request_prefix => $amqp_group_request_prefix,
|
||||
container_name => $amqp_container_name,
|
||||
idle_timeout => $amqp_idle_timeout,
|
||||
trace => $amqp_trace,
|
||||
ssl_ca_file => $amqp_ssl_ca_file,
|
||||
ssl_cert_file => $amqp_ssl_cert_file,
|
||||
ssl_key_file => $amqp_ssl_key_file,
|
||||
ssl_key_password => $amqp_ssl_key_password,
|
||||
allow_insecure_clients => $amqp_allow_insecure_clients,
|
||||
sasl_mechanisms => $amqp_sasl_mechanisms,
|
||||
sasl_config_dir => $amqp_sasl_config_dir,
|
||||
sasl_config_name => $amqp_sasl_config_name,
|
||||
username => $amqp_username,
|
||||
password => $amqp_password,
|
||||
}
|
||||
|
||||
oslo::messaging::default { 'aodh_config':
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
deprecations:
|
||||
- aodh::rpc_backend is deprecated and will be removed in a future
|
||||
release. Please use aodh::default_transport_url instead.
|
@ -219,37 +219,30 @@ describe 'aodh' do
|
||||
)}
|
||||
end
|
||||
|
||||
context 'with amqp rpc_backend' do
|
||||
let :params do
|
||||
{ :rpc_backend => 'amqp' }
|
||||
end
|
||||
|
||||
context 'with default parameters' do
|
||||
it 'configures amqp' do
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/server_request_prefix').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/broadcast_prefix').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/group_request_prefix').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/container_name').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/idle_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/trace').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/ssl_ca_file').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/ssl_cert_file').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/ssl_key_file').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/ssl_key_password').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/allow_insecure_clients').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/sasl_mechanisms').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/sasl_config_dir').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/sasl_config_name').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/username').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/password').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
context 'with default amqp parameters' do
|
||||
it 'configures amqp' do
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/server_request_prefix').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/broadcast_prefix').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/group_request_prefix').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/container_name').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/idle_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/trace').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/ssl_ca_file').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/ssl_cert_file').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/ssl_key_file').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/ssl_key_password').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/allow_insecure_clients').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/sasl_mechanisms').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/sasl_config_dir').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/sasl_config_name').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/username').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_aodh_config('oslo_messaging_amqp/password').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with overriden amqp parameters' do
|
||||
let :params do
|
||||
{ :rpc_backend => 'amqp',
|
||||
:default_transport_url => 'amqp://amqp_user:password@localhost:5672',
|
||||
{ :default_transport_url => 'amqp://amqp_user:password@localhost:5672',
|
||||
:amqp_idle_timeout => '60',
|
||||
:amqp_trace => true,
|
||||
:amqp_ssl_ca_file => '/etc/ca.cert',
|
||||
|
Loading…
Reference in New Issue
Block a user