Introduce support for oslo.messaging amqp driver configuration
This commit adds support for the oslo.messaging amqp rpc_backend which enables the AMQP 1.0 driver. A proposed feature for the Newton oslo.messaging release is an update to the AMQP 1.0 driver to support a stateless messaging interconnect for RPC traffic [1]. This patch: * use oslo::messaging::amqp resource * add new parameters for the oslo_messaging_amqp driver * update spec tests for amqp as alternate rpc_backend * add feature release note [1] https://blueprints.launchpad.net/oslo.messaging/+spec/amqp-dispatch-router Change-Id: I7505c51ba690e8d3a7cd8e59628fe21ee9e1dc1d
This commit is contained in:
parent
364bf18953
commit
41df393552
@ -132,6 +132,7 @@
|
|||||||
#
|
#
|
||||||
# [*rpc_backend*]
|
# [*rpc_backend*]
|
||||||
# (optional) The rpc backend implementation to use, can be:
|
# (optional) The rpc backend implementation to use, can be:
|
||||||
|
# amqp (for AMQP 1.0)
|
||||||
# rabbit (for rabbitmq)
|
# rabbit (for rabbitmq)
|
||||||
# zmq (for zeromq)
|
# zmq (for zeromq)
|
||||||
# Defaults to $::os_service_default.
|
# Defaults to $::os_service_default.
|
||||||
@ -248,6 +249,70 @@
|
|||||||
# (string value)
|
# (string value)
|
||||||
# Defaults to $::os_service_default.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
|
# [*amqp_server_request_prefix*]
|
||||||
|
# (Optional) Address prefix used when sending to a specific server
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_broadcast_prefix*]
|
||||||
|
# (Optional) address prefix used when broadcasting to all servers
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_group_request_prefix*]
|
||||||
|
# (Optional) address prefix when sending to any server in group
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_container_name*]
|
||||||
|
# (Optional) Name for the AMQP container
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_idle_timeout*]
|
||||||
|
# (Optional) Timeout for inactive connections
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_trace*]
|
||||||
|
# (Optional) Debug: dump AMQP frames to stdout
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_ssl_ca_file*]
|
||||||
|
# (Optional) CA certificate PEM file to verify server certificate
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_ssl_cert_file*]
|
||||||
|
# (Optional) Identifying certificate PEM file to present to clients
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_ssl_key_file*]
|
||||||
|
# (Optional) Private key PEM file used to sign cert_file certificate
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_ssl_key_password*]
|
||||||
|
# (Optional) Password for decrypting ssl_key_file (if encrypted)
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_allow_insecure_clients*]
|
||||||
|
# (Optional) Accept clients using either SSL or plain TCP
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_sasl_mechanisms*]
|
||||||
|
# (Optional) Space separated list of acceptable SASL mechanisms
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_sasl_config_dir*]
|
||||||
|
# (Optional) Path to directory that contains the SASL configuration
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_sasl_config_name*]
|
||||||
|
# (Optional) Name of configuration file (without .conf suffix)
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_username*]
|
||||||
|
# (Optional) User name for message broker authentication
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*amqp_password*]
|
||||||
|
# (Optional) Password for message broker authentication
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
# == DEPRECATED PARAMETERS
|
# == DEPRECATED PARAMETERS
|
||||||
#
|
#
|
||||||
# [*zeromq_port*]
|
# [*zeromq_port*]
|
||||||
@ -255,64 +320,80 @@
|
|||||||
# Defaults to undef.
|
# Defaults to undef.
|
||||||
#
|
#
|
||||||
class sahara(
|
class sahara(
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$verbose = undef,
|
$verbose = undef,
|
||||||
$debug = undef,
|
$debug = undef,
|
||||||
$use_syslog = undef,
|
$use_syslog = undef,
|
||||||
$use_stderr = undef,
|
$use_stderr = undef,
|
||||||
$log_facility = undef,
|
$log_facility = undef,
|
||||||
$log_dir = undef,
|
$log_dir = undef,
|
||||||
$host = $::os_service_default,
|
$host = $::os_service_default,
|
||||||
$port = $::os_service_default,
|
$port = $::os_service_default,
|
||||||
$plugins = $::os_service_default,
|
$plugins = $::os_service_default,
|
||||||
$use_neutron = $::os_service_default,
|
$use_neutron = $::os_service_default,
|
||||||
$use_floating_ips = $::os_service_default,
|
$use_floating_ips = $::os_service_default,
|
||||||
$use_ssl = $::os_service_default,
|
$use_ssl = $::os_service_default,
|
||||||
$ca_file = $::os_service_default,
|
$ca_file = $::os_service_default,
|
||||||
$cert_file = $::os_service_default,
|
$cert_file = $::os_service_default,
|
||||||
$key_file = $::os_service_default,
|
$key_file = $::os_service_default,
|
||||||
$database_connection = undef,
|
$database_connection = undef,
|
||||||
$database_idle_timeout = undef,
|
$database_idle_timeout = undef,
|
||||||
$database_min_pool_size = undef,
|
$database_min_pool_size = undef,
|
||||||
$database_max_pool_size = undef,
|
$database_max_pool_size = undef,
|
||||||
$database_max_retries = undef,
|
$database_max_retries = undef,
|
||||||
$database_retry_interval = undef,
|
$database_retry_interval = undef,
|
||||||
$database_max_overflow = undef,
|
$database_max_overflow = undef,
|
||||||
$sync_db = true,
|
$sync_db = true,
|
||||||
$admin_user = 'sahara',
|
$admin_user = 'sahara',
|
||||||
$admin_password = false,
|
$admin_password = false,
|
||||||
$admin_tenant_name = 'services',
|
$admin_tenant_name = 'services',
|
||||||
$auth_uri = 'http://127.0.0.1:5000/v2.0/',
|
$auth_uri = 'http://127.0.0.1:5000/v2.0/',
|
||||||
$identity_uri = 'http://127.0.0.1:35357/',
|
$identity_uri = 'http://127.0.0.1:35357/',
|
||||||
$rpc_backend = $::os_service_default,
|
$rpc_backend = $::os_service_default,
|
||||||
$amqp_durable_queues = $::os_service_default,
|
$amqp_durable_queues = $::os_service_default,
|
||||||
$rabbit_ha_queues = $::os_service_default,
|
$rabbit_ha_queues = $::os_service_default,
|
||||||
$rabbit_host = $::os_service_default,
|
$rabbit_host = $::os_service_default,
|
||||||
$rabbit_hosts = $::os_service_default,
|
$rabbit_hosts = $::os_service_default,
|
||||||
$rabbit_port = $::os_service_default,
|
$rabbit_port = $::os_service_default,
|
||||||
$rabbit_use_ssl = $::os_service_default,
|
$rabbit_use_ssl = $::os_service_default,
|
||||||
$rabbit_userid = $::os_service_default,
|
$rabbit_userid = $::os_service_default,
|
||||||
$rabbit_password = $::os_service_default,
|
$rabbit_password = $::os_service_default,
|
||||||
$rabbit_login_method = $::os_service_default,
|
$rabbit_login_method = $::os_service_default,
|
||||||
$rabbit_virtual_host = $::os_service_default,
|
$rabbit_virtual_host = $::os_service_default,
|
||||||
$rabbit_retry_interval = $::os_service_default,
|
$rabbit_retry_interval = $::os_service_default,
|
||||||
$rabbit_retry_backoff = $::os_service_default,
|
$rabbit_retry_backoff = $::os_service_default,
|
||||||
$rabbit_max_retries = $::os_service_default,
|
$rabbit_max_retries = $::os_service_default,
|
||||||
$zeromq_bind_address = $::os_service_default,
|
$zeromq_bind_address = $::os_service_default,
|
||||||
$zeromq_contexts = $::os_service_default,
|
$zeromq_contexts = $::os_service_default,
|
||||||
$zeromq_topic_backlog = $::os_service_default,
|
$zeromq_topic_backlog = $::os_service_default,
|
||||||
$zeromq_ipc_dir = $::os_service_default,
|
$zeromq_ipc_dir = $::os_service_default,
|
||||||
$zeromq_host = 'sahara',
|
$zeromq_host = 'sahara',
|
||||||
$cast_timeout = $::os_service_default,
|
$cast_timeout = $::os_service_default,
|
||||||
$kombu_ssl_version = $::os_service_default,
|
$kombu_ssl_version = $::os_service_default,
|
||||||
$kombu_ssl_keyfile = $::os_service_default,
|
$kombu_ssl_keyfile = $::os_service_default,
|
||||||
$kombu_ssl_certfile = $::os_service_default,
|
$kombu_ssl_certfile = $::os_service_default,
|
||||||
$kombu_ssl_ca_certs = $::os_service_default,
|
$kombu_ssl_ca_certs = $::os_service_default,
|
||||||
$kombu_reconnect_delay = $::os_service_default,
|
$kombu_reconnect_delay = $::os_service_default,
|
||||||
$kombu_failover_strategy = $::os_service_default,
|
$kombu_failover_strategy = $::os_service_default,
|
||||||
$kombu_compression = $::os_service_default,
|
$kombu_compression = $::os_service_default,
|
||||||
|
$amqp_server_request_prefix = $::os_service_default,
|
||||||
|
$amqp_broadcast_prefix = $::os_service_default,
|
||||||
|
$amqp_group_request_prefix = $::os_service_default,
|
||||||
|
$amqp_container_name = $::os_service_default,
|
||||||
|
$amqp_idle_timeout = $::os_service_default,
|
||||||
|
$amqp_trace = $::os_service_default,
|
||||||
|
$amqp_ssl_ca_file = $::os_service_default,
|
||||||
|
$amqp_ssl_cert_file = $::os_service_default,
|
||||||
|
$amqp_ssl_key_file = $::os_service_default,
|
||||||
|
$amqp_ssl_key_password = $::os_service_default,
|
||||||
|
$amqp_allow_insecure_clients = $::os_service_default,
|
||||||
|
$amqp_sasl_mechanisms = $::os_service_default,
|
||||||
|
$amqp_sasl_config_dir = $::os_service_default,
|
||||||
|
$amqp_sasl_config_name = $::os_service_default,
|
||||||
|
$amqp_username = $::os_service_default,
|
||||||
|
$amqp_password = $::os_service_default,
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
$zeromq_port = undef,
|
$zeromq_port = undef,
|
||||||
) {
|
) {
|
||||||
include ::sahara::params
|
include ::sahara::params
|
||||||
include ::sahara::logging
|
include ::sahara::logging
|
||||||
@ -389,6 +470,27 @@ class sahara(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $rpc_backend == 'amqp' {
|
||||||
|
oslo::messaging::amqp { 'sahara_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,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ! is_service_default($use_ssl) and $use_ssl {
|
if ! is_service_default($use_ssl) and $use_ssl {
|
||||||
if is_service_default($cert_file) {
|
if is_service_default($cert_file) {
|
||||||
fail('The cert_file parameter is required when use_ssl is set to true')
|
fail('The cert_file parameter is required when use_ssl is set to true')
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Add support for oslo_messaging_amqp backend via puppet-oslo resource
|
@ -209,6 +209,55 @@ describe 'sahara' do
|
|||||||
it { is_expected.to contain_sahara_config('DEFAULT/rpc_cast_timeout').with_value('30') }
|
it { is_expected.to contain_sahara_config('DEFAULT/rpc_cast_timeout').with_value('30') }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with amqp rpc' do
|
||||||
|
before do
|
||||||
|
params.merge!({ :rpc_backend => 'amqp' })
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with default parameters' do
|
||||||
|
it { is_expected.to contain_sahara_config('DEFAULT/rpc_backend').with_value('amqp') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/server_request_prefix').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/broadcast_prefix').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/group_request_prefix').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/container_name').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/idle_timeout').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/trace').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_ca_file').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_cert_file').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_key_file').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_key_password').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/allow_insecure_clients').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/sasl_mechanisms').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/sasl_config_dir').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/sasl_config_name').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/username').with_value('<SERVICE DEFAULT>') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/password').with_value('<SERVICE DEFAULT>') }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when pass parameters' do
|
||||||
|
before do
|
||||||
|
params.merge!({
|
||||||
|
:amqp_idle_timeout => '60',
|
||||||
|
:amqp_trace => true,
|
||||||
|
:amqp_ssl_ca_file => '/etc/ca.cert',
|
||||||
|
:amqp_ssl_cert_file => '/etc/certfile',
|
||||||
|
:amqp_ssl_key_file => '/etc/key',
|
||||||
|
:amqp_username => 'amqp_user',
|
||||||
|
:amqp_password => 'password',
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_sahara_config('DEFAULT/rpc_backend').with_value('amqp') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/idle_timeout').with_value('60') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/trace').with_value('true') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_ca_file').with_value('/etc/ca.cert') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_cert_file').with_value('/etc/certfile') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_key_file').with_value('/etc/key') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/username').with_value('amqp_user') }
|
||||||
|
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/password').with_value('password') }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'sahara ssl' do
|
shared_examples_for 'sahara ssl' do
|
||||||
|
Loading…
Reference in New Issue
Block a user