Merge "Use oslo module for messaging (rabbit) configuration"

This commit is contained in:
Jenkins 2016-04-23 12:28:21 +00:00 committed by Gerrit Code Review
commit 151ca19923
10 changed files with 215 additions and 366 deletions

View File

@ -210,7 +210,6 @@ class trove::api(
'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass; 'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass;
'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name; 'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
'DEFAULT/control_exchange': value => $::trove::control_exchange; 'DEFAULT/control_exchange': value => $::trove::control_exchange;
'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
} }
if $identity_uri { if $identity_uri {
@ -339,75 +338,31 @@ class trove::api(
'DEFAULT/heat_service_type': value => $::trove::heat_service_type; 'DEFAULT/heat_service_type': value => $::trove::heat_service_type;
} }
trove_config { oslo::messaging::notifications { 'trove_config':
'DEFAULT/notification_driver': value => join(any2array($::trove::notification_driver, ',')); driver => $::trove::notification_driver,
'DEFAULT/notification_topics': value => $::trove::notification_topics; topics => $::trove::notification_topics
} }
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' { if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' {
if ! $::trove::rabbit_password { oslo::messaging::rabbit {'trove_config':
fail('When rpc_backend is rabbitmq, you must set rabbit password') rabbit_hosts => $::trove::rabbit_hosts,
} rabbit_host => $::trove::rabbit_host,
if $::trove::rabbit_hosts { rabbit_port => $::trove::rabbit_port,
trove_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($::trove::rabbit_hosts, ',') } rabbit_ha_queues => $::trove::rabbit_ha_queues,
} else { rabbit_userid => $::trove::rabbit_userid,
trove_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host } rabbit_password => $::trove::rabbit_password,
trove_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port } rabbit_virtual_host => $::trove::rabbit_virtual_host,
trove_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" } rabbit_use_ssl => $::trove::rabbit_use_ssl,
} kombu_reconnect_delay => $::trove::kombu_reconnect_delay,
amqp_durable_queues => $::trove::amqp_durable_queues,
if $::trove::rabbit_ha_queues == undef { kombu_ssl_ca_certs => $::trove::kombu_ssl_ca_certs,
if size($::trove::rabbit_hosts) > 1 { kombu_ssl_certfile => $::trove::kombu_ssl_certfile,
trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true } kombu_ssl_keyfile => $::trove::kombu_ssl_keyfile,
} else { kombu_ssl_version => $::trove::kombu_ssl_version
trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}
} else {
trove_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $::trove::rabbit_ha_queues }
}
trove_config {
'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl;
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
}
if $::trove::rabbit_use_ssl {
if $::trove::kombu_ssl_ca_certs {
trove_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $::trove::kombu_ssl_ca_certs; }
} else {
trove_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
}
if $::trove::kombu_ssl_certfile or $::trove::kombu_ssl_keyfile {
trove_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $::trove::kombu_ssl_certfile;
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $::trove::kombu_ssl_keyfile;
} }
} else { } else {
trove_config { trove_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent; 'DEFAULT/rpc_backend' : value => $::trove::rpc_backend;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
}
}
if $::trove::kombu_ssl_version {
trove_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $::trove::kombu_ssl_version; }
} else {
trove_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
}
} else {
trove_config {
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
}
} }
} }

View File

@ -108,7 +108,6 @@ class trove::conductor(
'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name; 'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass; 'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass;
'DEFAULT/control_exchange': value => $::trove::control_exchange; 'DEFAULT/control_exchange': value => $::trove::control_exchange;
'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
'DEFAULT/trove_conductor_workers': value => $workers; 'DEFAULT/trove_conductor_workers': value => $workers;
} }
# profiler config # profiler config
@ -117,70 +116,31 @@ class trove::conductor(
'profiler/trace_sqlalchemy': value => $trace_sqlalchemy; 'profiler/trace_sqlalchemy': value => $trace_sqlalchemy;
} }
oslo::messaging::notifications { 'trove_conductor_config':
driver => $::trove::notification_driver,
topics => $::trove::notification_topics
}
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' { if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' {
if ! $::trove::rabbit_password { oslo::messaging::rabbit {'trove_conductor_config':
fail('When rpc_backend is rabbitmq, you must set rabbit password') rabbit_hosts => $::trove::rabbit_hosts,
} rabbit_host => $::trove::rabbit_host,
if $::trove::rabbit_hosts { rabbit_port => $::trove::rabbit_port,
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($::trove::rabbit_hosts, ',') } rabbit_ha_queues => $::trove::rabbit_ha_queues,
} else { rabbit_userid => $::trove::rabbit_userid,
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host } rabbit_password => $::trove::rabbit_password,
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port } rabbit_virtual_host => $::trove::rabbit_virtual_host,
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" } rabbit_use_ssl => $::trove::rabbit_use_ssl,
} kombu_reconnect_delay => $::trove::kombu_reconnect_delay,
amqp_durable_queues => $::trove::amqp_durable_queues,
if $::trove::rabbit_ha_queues == undef { kombu_ssl_ca_certs => $::trove::kombu_ssl_ca_certs,
if size($::trove::rabbit_hosts) > 1 { kombu_ssl_certfile => $::trove::kombu_ssl_certfile,
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true } kombu_ssl_keyfile => $::trove::kombu_ssl_keyfile,
} else { kombu_ssl_version => $::trove::kombu_ssl_version
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}
} else {
trove_conductor_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $::trove::rabbit_ha_queues }
}
trove_conductor_config {
'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl;
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
}
if $::trove::rabbit_use_ssl {
if $::trove::kombu_ssl_ca_certs {
trove_conductor_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $::trove::kombu_ssl_ca_certs; }
} else {
trove_conductor_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
}
if $::trove::kombu_ssl_certfile or $::trove::kombu_ssl_keyfile {
trove_conductor_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $::trove::kombu_ssl_certfile;
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $::trove::kombu_ssl_keyfile;
} }
} else { } else {
trove_conductor_config { trove_conductor_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent; 'DEFAULT/rpc_backend' : value => $::trove::rpc_backend
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
}
}
if $::trove::kombu_ssl_version {
trove_conductor_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $::trove::kombu_ssl_version; }
} else {
trove_conductor_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
}
} else {
trove_conductor_config {
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
}
} }
} }

View File

@ -79,7 +79,6 @@ class trove::guestagent(
'DEFAULT/trove_auth_url': value => $auth_url; 'DEFAULT/trove_auth_url': value => $auth_url;
'DEFAULT/swift_url': value => $swift_url; 'DEFAULT/swift_url': value => $swift_url;
'DEFAULT/control_exchange': value => $control_exchange; 'DEFAULT/control_exchange': value => $control_exchange;
'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
} }
# region name # region name
@ -90,75 +89,31 @@ class trove::guestagent(
trove_guestagent_config { 'DEFAULT/os_region_name': ensure => absent } trove_guestagent_config { 'DEFAULT/os_region_name': ensure => absent }
} }
trove_guestagent_config { oslo::messaging::notifications { 'trove_guestagent_config':
'DEFAULT/notification_driver': value => join(any2array($::trove::notification_driver, ',')); driver => $::trove::notification_driver,
'DEFAULT/notification_topics': value => $::trove::notification_topics; topics => $::trove::notification_topics
} }
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' { if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' {
if ! $::trove::rabbit_password { oslo::messaging::rabbit {'trove_guestagent_config':
fail('When rpc_backend is rabbitmq, you must set rabbit password') rabbit_hosts => $::trove::rabbit_hosts,
} rabbit_host => $::trove::rabbit_host,
if $::trove::rabbit_hosts { rabbit_port => $::trove::rabbit_port,
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($::trove::rabbit_hosts, ',') } rabbit_ha_queues => $::trove::rabbit_ha_queues,
} else { rabbit_userid => $::trove::rabbit_userid,
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host } rabbit_password => $::trove::rabbit_password,
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port } rabbit_virtual_host => $::trove::rabbit_virtual_host,
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" } rabbit_use_ssl => $::trove::rabbit_use_ssl,
} kombu_reconnect_delay => $::trove::kombu_reconnect_delay,
amqp_durable_queues => $::trove::amqp_durable_queues,
if $::trove::rabbit_ha_queues == undef { kombu_ssl_ca_certs => $::trove::kombu_ssl_ca_certs,
if size($::trove::rabbit_hosts) > 1 { kombu_ssl_certfile => $::trove::kombu_ssl_certfile,
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true } kombu_ssl_keyfile => $::trove::kombu_ssl_keyfile,
} else { kombu_ssl_version => $::trove::kombu_ssl_version
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
}
} else {
trove_guestagent_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $::trove::rabbit_ha_queues }
}
trove_guestagent_config {
'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl;
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
}
if $::trove::rabbit_use_ssl {
if $::trove::kombu_ssl_ca_certs {
trove_guestagent_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $::trove::kombu_ssl_ca_certs; }
} else {
trove_guestagent_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
}
if $::trove::kombu_ssl_certfile or $::trove::kombu_ssl_keyfile {
trove_guestagent_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $::trove::kombu_ssl_certfile;
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $::trove::kombu_ssl_keyfile;
} }
} else { } else {
trove_guestagent_config { trove_guestagent_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent; 'DEFAULT/rpc_backend' : value => $::trove::rpc_backend
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
}
}
if $::trove::kombu_ssl_version {
trove_guestagent_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $::trove::kombu_ssl_version; }
} else {
trove_guestagent_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
}
} else {
trove_guestagent_config {
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
}
} }
} }

View File

@ -23,71 +23,71 @@
# [*notification_driver*] # [*notification_driver*]
# (optional) Driver or drivers to handle sending notifications. # (optional) Driver or drivers to handle sending notifications.
# Value can be a string or a list. # Value can be a string or a list.
# Defaults to noop # Defaults to $::os_service_default
# #
# [*notification_topics*] # [*notification_topics*]
# (optional) AMQP topic used for OpenStack notifications # (optional) AMQP topic used for OpenStack notifications
# Defaults to 'notifications' # Defaults to $::os_service_default
# #
# [*rabbit_host*] # [*rabbit_host*]
# (optional) Location of rabbitmq installation. # (optional) Location of rabbitmq installation.
# Note that, for security reasons, this rabbitmq host should not be the # Note that, for security reasons, this rabbitmq host should not be the
# same that the core openstack services are using for communication. See # same that the core openstack services are using for communication. See
# http://lists.openstack.org/pipermail/openstack-dev/2015-April/061759.html # http://lists.openstack.org/pipermail/openstack-dev/2015-April/061759.html
# Defaults to 'localhost' # Defaults to $::os_service_default
# #
# [*rabbit_hosts*] # [*rabbit_hosts*]
# (optional) List of clustered rabbit servers. # (optional) List of clustered rabbit servers.
# Note that, for security reasons, these rabbitmq hosts should not be the # Note that, for security reasons, these rabbitmq hosts should not be the
# same that the core openstack services are using for communication. See # same that the core openstack services are using for communication. See
# http://lists.openstack.org/pipermail/openstack-dev/2015-April/061759.html # http://lists.openstack.org/pipermail/openstack-dev/2015-April/061759.html
# Defaults to false # Defaults to $::os_service_default
# #
# [*rabbit_port*] # [*rabbit_port*]
# (optional) Port for rabbitmq instance. # (optional) Port for rabbitmq instance.
# Defaults to '5672' # Defaults to $::os_service_default
# #
# [*rabbit_password*] # [*rabbit_password*]
# (optional) Password used to connect to rabbitmq. # (optional) Password used to connect to rabbitmq.
# Defaults to 'guest' # Defaults to $::os_service_default
# #
# [*rabbit_userid*] # [*rabbit_userid*]
# (optional) User used to connect to rabbitmq. # (optional) User used to connect to rabbitmq.
# Defaults to 'guest' # Defaults to $::os_service_default
# #
# [*rabbit_virtual_host*] # [*rabbit_virtual_host*]
# (optional) The RabbitMQ virtual host. # (optional) The RabbitMQ virtual host.
# Defaults to '/' # Defaults to $::os_service_default
# #
# [*rabbit_use_ssl*] # [*rabbit_use_ssl*]
# (optional) Connect over SSL for RabbitMQ # (optional) Connect over SSL for RabbitMQ
# Defaults to false # Defaults to $::os_service_default
# #
# [*rabbit_notification_topic*] # [*rabbit_notification_topic*]
# (optional) Notification topic. # (optional) Notification topic.
# Defaults to false. # Defaults to $::os_service_default
# #
# [*kombu_ssl_ca_certs*] # [*kombu_ssl_ca_certs*]
# (optional) SSL certification authority file (valid only if SSL enabled). # (optional) SSL certification authority file (valid only if SSL enabled).
# Defaults to undef # Defaults to $::os_service_default
# #
# [*kombu_ssl_certfile*] # [*kombu_ssl_certfile*]
# (optional) SSL cert file (valid only if SSL enabled). # (optional) SSL cert file (valid only if SSL enabled).
# Defaults to undef # Defaults to $::os_service_default
# #
# [*kombu_ssl_keyfile*] # [*kombu_ssl_keyfile*]
# (optional) SSL key file (valid only if SSL enabled). # (optional) SSL key file (valid only if SSL enabled).
# Defaults to undef # Defaults to $::os_service_default
# #
# [*kombu_ssl_version*] # [*kombu_ssl_version*]
# (optional) SSL version to use (valid only if SSL enabled). # (optional) SSL version to use (valid only if SSL enabled).
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be # Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
# available on some distributions. # available on some distributions.
# Defaults to 'TLSv1' # Defaults to $::os_service_default
# #
# [*rabbit_ha_queues*] # [*rabbit_ha_queues*]
# (optional) Use HA queues in RabbitMQ (x-ha-policy: all). # (optional) Use HA queues in RabbitMQ (x-ha-policy: all).
# Defaults to undef # Defaults to $::os_service_default
# #
# [*kombu_reconnect_delay*] # [*kombu_reconnect_delay*]
# (optional) How long to wait before reconnecting in response to an AMQP # (optional) How long to wait before reconnecting in response to an AMQP
@ -96,7 +96,7 @@
# #
# [*amqp_durable_queues*] # [*amqp_durable_queues*]
# (optional) Define queues as "durable" to rabbitmq. # (optional) Define queues as "durable" to rabbitmq.
# Defaults to false # Defaults to $::os_service_default
# #
# [*rpc_backend*] # [*rpc_backend*]
# (optional) The rpc backend implementation to use, can be: # (optional) The rpc backend implementation to use, can be:
@ -200,23 +200,23 @@
# #
class trove( class trove(
$nova_proxy_admin_pass, $nova_proxy_admin_pass,
$notification_driver = 'noop', $notification_driver = $::os_service_default,
$notification_topics = 'notifications', $notification_topics = $::os_service_default,
$rabbit_host = 'localhost', $rabbit_host = $::os_service_default,
$rabbit_hosts = undef, $rabbit_hosts = $::os_service_default,
$rabbit_password = 'guest', $rabbit_password = $::os_service_default,
$rabbit_port = '5672', $rabbit_port = $::os_service_default,
$rabbit_userid = 'guest', $rabbit_userid = $::os_service_default,
$rabbit_virtual_host = '/', $rabbit_virtual_host = $::os_service_default,
$rabbit_use_ssl = false, $rabbit_use_ssl = $::os_service_default,
$rabbit_ha_queues = undef, $rabbit_ha_queues = $::os_service_default,
$rabbit_notification_topic = 'notifications', $rabbit_notification_topic = $::os_service_default,
$kombu_ssl_ca_certs = undef, $kombu_ssl_ca_certs = $::os_service_default,
$kombu_ssl_certfile = undef, $kombu_ssl_certfile = $::os_service_default,
$kombu_ssl_keyfile = undef, $kombu_ssl_keyfile = $::os_service_default,
$kombu_ssl_version = 'TLSv1', $kombu_ssl_version = $::os_service_default,
$kombu_reconnect_delay = $::os_service_default, $kombu_reconnect_delay = $::os_service_default,
$amqp_durable_queues = false, $amqp_durable_queues = $::os_service_default,
$database_connection = undef, $database_connection = undef,
$database_idle_timeout = undef, $database_idle_timeout = undef,
$database_max_retries = undef, $database_max_retries = undef,

View File

@ -129,7 +129,6 @@ class trove::taskmanager(
'DEFAULT/nova_proxy_admin_user': value => $::trove::nova_proxy_admin_user; 'DEFAULT/nova_proxy_admin_user': value => $::trove::nova_proxy_admin_user;
'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass; 'DEFAULT/nova_proxy_admin_pass': value => $::trove::nova_proxy_admin_pass;
'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name; 'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
'DEFAULT/rpc_backend': value => $::trove::rpc_backend;
} }
trove_config { trove_config {
@ -153,76 +152,31 @@ class trove::taskmanager(
'DEFAULT/heat_service_type': value => $::trove::heat_service_type; 'DEFAULT/heat_service_type': value => $::trove::heat_service_type;
} }
trove_taskmanager_config { oslo::messaging::notifications { 'trove_taskmanager_config':
'DEFAULT/notification_driver': value => join(any2array($::trove::notification_driver, ',')); driver => $::trove::notification_driver,
'DEFAULT/notification_topics': value => $::trove::notification_topics; topics => $::trove::notification_topics
} }
if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit'{ if $::trove::rpc_backend == 'trove.openstack.common.rpc.impl_kombu' or $::trove::rpc_backend == 'rabbit' {
if ! $::trove::rabbit_password { oslo::messaging::rabbit { 'trove_taskmanager_config':
fail('When rpc_backend is rabbitmq, you must set rabbit password') rabbit_hosts => $::trove::rabbit_hosts,
} rabbit_host => $::trove::rabbit_host,
if $::trove::rabbit_hosts { rabbit_port => $::trove::rabbit_port,
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($::trove::rabbit_hosts, ',') } rabbit_ha_queues => $::trove::rabbit_ha_queues,
} else { rabbit_userid => $::trove::rabbit_userid,
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_host': value => $::trove::rabbit_host } rabbit_password => $::trove::rabbit_password,
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_port': value => $::trove::rabbit_port } rabbit_virtual_host => $::trove::rabbit_virtual_host,
trove_taskmanager_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${::trove::rabbit_host}:${::trove::rabbit_port}" } rabbit_use_ssl => $::trove::rabbit_use_ssl,
} kombu_reconnect_delay => $::trove::kombu_reconnect_delay,
amqp_durable_queues => $::trove::amqp_durable_queues,
if $::trove::rabbit_ha_queues == undef { kombu_ssl_ca_certs => $::trove::kombu_ssl_ca_certs,
if size($::trove::rabbit_hosts) > 1 { kombu_ssl_certfile => $::trove::kombu_ssl_certfile,
$rabbit_ha_queues_real = true kombu_ssl_keyfile => $::trove::kombu_ssl_keyfile,
} else { kombu_ssl_version => $::trove::kombu_ssl_version
$rabbit_ha_queues_real = false
}
} else {
$rabbit_ha_queues_real = $::trove::rabbit_ha_queues
}
trove_taskmanager_config {
'oslo_messaging_rabbit/rabbit_userid': value => $::trove::rabbit_userid;
'oslo_messaging_rabbit/rabbit_password': value => $::trove::rabbit_password, secret => true;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $::trove::rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_use_ssl': value => $::trove::rabbit_use_ssl;
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $::trove::kombu_reconnect_delay;
'oslo_messaging_rabbit/amqp_durable_queues': value => $::trove::amqp_durable_queues;
'oslo_messaging_rabbit/rabbit_ha_queues': value => $rabbit_ha_queues_real
}
if $::trove::rabbit_use_ssl {
if $::trove::kombu_ssl_ca_certs {
trove_taskmanager_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $::trove::kombu_ssl_ca_certs; }
} else {
trove_taskmanager_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
}
if $::trove::kombu_ssl_certfile or $::trove::kombu_ssl_keyfile {
trove_taskmanager_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $::trove::kombu_ssl_certfile;
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $::trove::kombu_ssl_keyfile;
} }
} else { } else {
trove_taskmanager_config { trove_taskmanager_config {
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent; 'DEFAULT/rpc_backend' : value => $::trove::rpc_backend
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
}
}
if $::trove::kombu_ssl_version {
trove_taskmanager_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $::trove::kombu_ssl_version; }
} else {
trove_taskmanager_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
}
} else {
trove_taskmanager_config {
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
}
} }
} }

View File

@ -84,13 +84,13 @@ describe 'trove::api' do
is_expected.to contain_trove_config('DEFAULT/http_put_rate').with_value('200') is_expected.to contain_trove_config('DEFAULT/http_put_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/http_delete_rate').with_value('200') is_expected.to contain_trove_config('DEFAULT/http_delete_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/http_mgmt_post_rate').with_value('200') is_expected.to contain_trove_config('DEFAULT/http_mgmt_post_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/notification_driver').with_value('noop,') is_expected.to contain_trove_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/notification_topics').with_value('notifications') is_expected.to contain_trove_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_userid').with_value('guest') is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_password').with_value('guest') is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false) is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false) is_expected.to contain_trove_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('ssl/cert_file').with_ensure('absent') is_expected.to contain_trove_config('ssl/cert_file').with_ensure('absent')
is_expected.to contain_trove_config('ssl/key_file').with_ensure('absent') is_expected.to contain_trove_config('ssl/key_file').with_ensure('absent')
is_expected.to contain_trove_config('ssl/ca_file').with_ensure('absent') is_expected.to contain_trove_config('ssl/ca_file').with_ensure('absent')
@ -161,8 +161,8 @@ describe 'trove::api' do
end end
it 'configures trove-api with RabbitMQ' do it 'configures trove-api with RabbitMQ' do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1') is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('false') is_expected.to contain_trove_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
end end
end end
@ -185,6 +185,7 @@ describe 'trove::api' do
let :pre_condition do let :pre_condition do
"class { 'trove': "class { 'trove':
nova_proxy_admin_pass => 'verysecrete', nova_proxy_admin_pass => 'verysecrete',
rabbit_ha_queues => 'true',
rabbit_hosts => ['10.0.0.1','10.0.0.2']}" rabbit_hosts => ['10.0.0.1','10.0.0.2']}"
end end
it 'configures trove-api with RabbitMQ' do it 'configures trove-api with RabbitMQ' do
@ -224,10 +225,10 @@ describe 'trove::api' do
it do it do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1') is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
end end
end end
@ -235,16 +236,15 @@ describe 'trove::api' do
let :pre_condition do let :pre_condition do
"class { 'trove': "class { 'trove':
nova_proxy_admin_pass => 'verysecrete', nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => false, rabbit_use_ssl => false}"
kombu_ssl_version => 'TLSv1'}"
end end
it do it do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false') is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent') is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
end end
end end

View File

@ -31,11 +31,11 @@ describe 'trove::conductor' do
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_user').with_value('admin') is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_user').with_value('admin')
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_pass').with_value('verysecrete') is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_pass').with_value('verysecrete')
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin') is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_userid').with_value('guest') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_password').with_value('guest') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false) is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false) is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/trove_conductor_workers').with_value('8') is_expected.to contain_trove_conductor_config('DEFAULT/trove_conductor_workers').with_value('8')
is_expected.to contain_trove_conductor_config('profiler/enabled').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_conductor_config('profiler/enabled').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('profiler/trace_sqlalchemy').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_conductor_config('profiler/trace_sqlalchemy').with_value('<SERVICE DEFAULT>')
@ -49,8 +49,8 @@ describe 'trove::conductor' do
end end
it 'configures trove-conductor with RabbitMQ' do it 'configures trove-conductor with RabbitMQ' do
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('false') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
end end
end end
@ -122,10 +122,10 @@ describe 'trove::conductor' do
it do it do
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
end end
end end
@ -133,16 +133,15 @@ describe 'trove::conductor' do
let :pre_condition do let :pre_condition do
"class { 'trove': "class { 'trove':
nova_proxy_admin_pass => 'verysecrete', nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => false, rabbit_use_ssl => false}"
kombu_ssl_version => 'TLSv1'}"
end end
it do it do
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
end end
end end

View File

@ -30,13 +30,13 @@ describe 'trove::guestagent' do
is_expected.to contain_trove_guestagent_config('DEFAULT/verbose').with_value(false) is_expected.to contain_trove_guestagent_config('DEFAULT/verbose').with_value(false)
is_expected.to contain_trove_guestagent_config('DEFAULT/debug').with_value(false) is_expected.to contain_trove_guestagent_config('DEFAULT/debug').with_value(false)
is_expected.to contain_trove_guestagent_config('DEFAULT/os_region_name').with_value('RegionOne') is_expected.to contain_trove_guestagent_config('DEFAULT/os_region_name').with_value('RegionOne')
is_expected.to contain_trove_guestagent_config('DEFAULT/notification_driver').with_value('noop,') is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/notification_topics').with_value('notifications') is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_userid').with_value('guest') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_password').with_value('guest') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false) is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false) is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
end end
context 'when using a single RabbitMQ server' do context 'when using a single RabbitMQ server' do
@ -47,8 +47,8 @@ describe 'trove::guestagent' do
end end
it 'configures trove-guestagent with RabbitMQ' do it 'configures trove-guestagent with RabbitMQ' do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('false') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
end end
end end
@ -126,10 +126,10 @@ describe 'trove::guestagent' do
it do it do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
end end
end end
@ -137,16 +137,15 @@ describe 'trove::guestagent' do
let :pre_condition do let :pre_condition do
"class { 'trove': "class { 'trove':
nova_proxy_admin_pass => 'verysecrete', nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => false, rabbit_use_ssl => false}"
kombu_ssl_version => 'TLSv1'}"
end end
it do it do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent') is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
end end
end end

View File

@ -66,13 +66,13 @@ describe 'trove::taskmanager' do
is_expected.to contain_trove_taskmanager_config('DEFAULT/neutron_service_type').with_value('network') is_expected.to contain_trove_taskmanager_config('DEFAULT/neutron_service_type').with_value('network')
is_expected.to contain_trove_config('DEFAULT/taskmanager_queue').with_value('taskmanager') is_expected.to contain_trove_config('DEFAULT/taskmanager_queue').with_value('taskmanager')
is_expected.to contain_file('/etc/trove/trove-guestagent.conf') is_expected.to contain_file('/etc/trove/trove-guestagent.conf')
is_expected.to contain_trove_taskmanager_config('DEFAULT/notification_driver').with_value('noop,') is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/notification_topics').with_value('notifications') is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_userid').with_value('guest') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_password').with_value('guest') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false) is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false) is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
end end
context 'when set use_guestagent_template to false' do context 'when set use_guestagent_template to false' do
@ -98,13 +98,13 @@ describe 'trove::taskmanager' do
end end
it 'configures trove-taskmanager with RabbitMQ' do it 'configures trove-taskmanager with RabbitMQ' do
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_host').with_value('10.0.0.1')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('false') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
# trove taskmanager also configures trove_guestagent.conf by default, ensure rabbit is right there # trove taskmanager also configures trove_guestagent.conf by default, ensure rabbit is right there
is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^rabbit_host=10.0.0.1$/) is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^rabbit_host=10.0.0.1$/)
is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^rabbit_port=5672$/) is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^#rabbit_port=5672$/)
is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^rabbit_ha_queues=false$/) is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^#rabbit_ha_queues=false$/)
end end
end end
@ -123,7 +123,7 @@ describe 'trove::taskmanager' do
# trove taskmanager also configures trove_guestagent.conf by default, ensure rabbit is right there # trove taskmanager also configures trove_guestagent.conf by default, ensure rabbit is right there
is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^rabbit_host=10.0.0.1$/) is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^rabbit_host=10.0.0.1$/)
is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^rabbit_port=5672$/) is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^#rabbit_port=5672$/)
is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^rabbit_ha_queues=true$/) is_expected.to contain_file('/etc/trove/trove-guestagent.conf').with_content(/^rabbit_ha_queues=true$/)
end end
end end
@ -230,10 +230,10 @@ describe 'trove::taskmanager' do
it do it do
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
end end
end end
@ -241,16 +241,15 @@ describe 'trove::taskmanager' do
let :pre_condition do let :pre_condition do
"class { 'trove': "class { 'trove':
nova_proxy_admin_pass => 'verysecrete', nova_proxy_admin_pass => 'verysecrete',
rabbit_use_ssl => false, rabbit_use_ssl => false}"
kombu_ssl_version => 'TLSv1'}"
end end
it do it do
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent') is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
end end
end end

View File

@ -78,7 +78,7 @@ backup_segment_max_size = 2147483648
[oslo_messaging_rabbit] [oslo_messaging_rabbit]
# ============ RabbitMQ connection options ======================== # ============ RabbitMQ connection options ========================
<%- if @rabbit_hosts -%> <%- if @rabbit_hosts and @rabbit_hosts != "<SERVICE DEFAULT>" -%>
# RabbitMQ HA cluster host:port pairs. (list value) # RabbitMQ HA cluster host:port pairs. (list value)
rabbit_hosts=<%= @rabbit_hosts.join(',') %> rabbit_hosts=<%= @rabbit_hosts.join(',') %>
@ -92,23 +92,51 @@ rabbit_hosts=<%= @rabbit_hosts.join(',') %>
<%- else -%> <%- else -%>
# The RabbitMQ broker address where a single node is used. # The RabbitMQ broker address where a single node is used.
# (string value) # (string value)
<%- if @rabbit_host and @rabbit_host != "<SERVICE DEFAULT>" -%>
rabbit_host=<%= @rabbit_host %> rabbit_host=<%= @rabbit_host %>
<%- else -%>
#rabbit_host=localhost
<%- end -%>
# The RabbitMQ broker port where a single node is used. # The RabbitMQ broker port where a single node is used.
# (integer value) # (integer value)
<%- if @rabbit_port and @rabbit_port != "<SERVICE DEFAULT>" -%>
rabbit_port=<%= @rabbit_port %> rabbit_port=<%= @rabbit_port %>
<%- else -%>
#rabbit_port=5672
<%- end -%>
<%- end -%> <%- end -%>
# The RabbitMQ userid. (string value) # The RabbitMQ userid. (string value)
<%- if @rabbit_userid and @rabbit_userid != "<SERVICE DEFAULT>" -%>
rabbit_userid=<%= @rabbit_userid %> rabbit_userid=<%= @rabbit_userid %>
<%- else -%>
#rabbit_userid=guest
<%- end -%>
# The RabbitMQ password. (string value) # The RabbitMQ password. (string value)
<%- if @rabbit_password and @rabbit_password != "<SERVICE DEFAULT>" -%>
rabbit_password=<%= @rabbit_password %> rabbit_password=<%= @rabbit_password %>
<%- else -%>
#rabbit_password=guest
<%- end -%>
# The RabbitMQ virtual host. (string value) # The RabbitMQ virtual host. (string value)
<%- if @rabbit_virtual_host and @rabbit_virtual_host != "<SERVICE DEFAULT>" -%>
rabbit_virtual_host=<%= @rabbit_virtual_host %> rabbit_virtual_host=<%= @rabbit_virtual_host %>
<%- else -%>
#rabbit_virtual_host=/
<%- end -%>
rabbit_ha_queues=<%= @rabbit_ha_queues_real %> <%- if @rabbit_ha_queues and @rabbit_ha_queues != "<SERVICE DEFAULT>" -%>
rabbit_ha_queues=<%= @rabbit_ha_queues %>
<%- else -%>
<%- if @rabbit_hosts and @rabbit_hosts != "<SERVICE DEFAULT>" -%>
rabbit_ha_queues=true
<%- else -%>
#rabbit_ha_queues=false
<%- end -%>
<%- end -%>
# ========== Datastore Specific Configuration Options ========== # ========== Datastore Specific Configuration Options ==========