Update parameters for Sahara

Remove wrong and update parameters for sahara.conf

[1] http://docs.openstack.org/kilo/config-reference/content/ch_configuring-sahara.html

Change-Id: I222f5d63a7f0518ac04546915dcb12156840c8d4
This commit is contained in:
Denis Egorenko 2015-07-27 13:02:06 +03:00
parent 12d2ec8fb7
commit f590f384a9
9 changed files with 309 additions and 177 deletions

View File

@ -31,13 +31,13 @@ class { '::sahara':
database_connection => 'mysql://sahara:a_big_secret@127.0.0.1:3306/sahara',
verbose => true,
debug => true,
keystone_username => 'admin',
keystone_password => 'secrets_everywhere',
keystone_tenant => 'admin',
keystone_url => 'http://127.0.0.1:5000/v2.0/',
identity_url => 'http://127.0.0.1:35357/',
service_host => '0.0.0.0',
service_port => 8386,
admin_user => 'admin',
admin_password => 'secrets_everywhere',
admin_tenant_name => 'admin',
auth_uri => 'http://127.0.0.1:5000/v2.0/',
identity_uri => 'http://127.0.0.1:35357/',
host => '0.0.0.0',
port => 8386,
use_floating_ips => true,
}

View File

@ -41,11 +41,11 @@
# If set to boolean false, it will not log to any directory.
# Defaults to '/var/log/sahara'
#
# [*service_host*]
# [*host*]
# (Optional) Hostname for sahara to listen on
# Defaults to '0.0.0.0'.
#
# [*service_port*]
# [*port*]
# (Optional) Port for sahara to listen on
# Defaults to 8386.
#
@ -77,32 +77,70 @@
# (Optional) Non-sqllite database for sahara
# Defaults to 'mysql://sahara:secrete@localhost:3306/sahara'
#
# == keystone authentication options
#
# [*keystone_username*]
# (Optional) Username for sahara credentials
# Defaults to 'admin'.
#
# [*keystone_password*]
# (Optional) Password for sahara credentials
# Defaults to false.
#
# [*keystone_tenant*]
# (Optional) Tenant for keystone_username
# Defaults to 'admin'.
#
# [*keystone_url*]
# (Optional) Public identity endpoint
# Defaults to 'http://127.0.0.1:5000/v2.0/'.
#
# [*identity_url*]
# (Optional) Admin identity endpoint
# Defaults to 'http://127.0.0.1:35357/'.
#
# [*sync_db*]
# (Optional) Enable dbsync
# Defaults to true.
#
# == keystone authentication options
#
# [*admin_user*]
# (Optional) Service user name
# Defaults to 'admin'.
#
# [*admin_password*]
# (Optional) Service user password.
# Defaults to false.
#
# [*admin_tenant_name*]
# (Optional) Service tenant name.
# Defaults to 'admin'.
#
# [*auth_uri*]
# (Optional) Complete public Identity API endpoint.
# Defaults to 'http://127.0.0.1:5000/v2.0/'.
#
# [*identity_uri*]
# (Optional) Complete admin Identity API endpoint.
# This should specify the unversioned root endpoint.
# Defaults to 'http://127.0.0.1:35357/'.
#
# == DEPRECATED PARAMETERS
#
# [*service_host*]
# (Optional) DEPRECATED: Use host instead.
# Hostname for sahara to listen on
# Defaults to undef.
#
# [*service_port*]
# (Optional) DEPRECATED: Use port instead.
# Port for sahara to listen on
# Defaults to undef.
#
# [*keystone_username*]
# (Optional) DEPRECATED: Use admin_user instead.
# Username for sahara credentials
# Defaults to undef.
#
# [*keystone_password*]
# (Optional) DEPRECATED: Use admin_password instead.
# Password for sahara credentials
# Defaults to undef.
#
# [*keystone_tenant*]
# (Optional) DEPRECATED: Use admin_tenant_name instead.
# Tenant for keystone_username
# Defaults to undef.
#
# [*keystone_url*]
# (Optional) DEPRECATED: Use auth_uri instead.
# Public identity endpoint
# Defaults to undef.
#
# [*identity_url*]
# (Optional) DEPRECATED: Use identity_uri instead.
# Admin identity endpoint
# Defaults to undef.
#
class sahara(
$manage_service = true,
$enabled = true,
@ -113,8 +151,8 @@ class sahara(
$use_stderr = true,
$log_facility = 'LOG_USER',
$log_dir = '/var/log/sahara',
$service_host = '0.0.0.0',
$service_port = 8386,
$host = '0.0.0.0',
$port = '8386',
$use_neutron = false,
$use_floating_ips = true,
$use_ssl = false,
@ -122,16 +160,73 @@ class sahara(
$cert_file = undef,
$key_file = undef,
$database_connection = 'mysql://sahara:secrete@localhost:3306/sahara',
$keystone_username = 'admin',
$keystone_password = false,
$keystone_tenant = 'admin',
$keystone_url = 'http://127.0.0.1:5000/v2.0/',
$identity_url = 'http://127.0.0.1:35357/',
$sync_db = true,
$admin_user = 'admin',
$admin_password = false,
$admin_tenant_name = 'admin',
$auth_uri = 'http://127.0.0.1:5000/v2.0/',
$identity_uri = 'http://127.0.0.1:35357/',
# DEPRECATED PARAMETERS
$service_host = undef,
$service_port = undef,
$keystone_username = undef,
$keystone_password = undef,
$keystone_tenant = undef,
$keystone_url = undef,
$identity_url = undef,
) {
include ::sahara::params
include ::sahara::policy
if $service_host {
warning('The service_host parameter is deprecated. Use host parameter instead')
$host_real = $service_host
} else {
$host_real = $host
}
if $service_port {
warning('The service_port parameter is deprecated. Use port parameter instead')
$port_real = $service_port
} else {
$port_real = $port
}
if $keystone_username {
warning('The keystone_username parameter is deprecated. Use admin_user parameter instead')
$admin_user_real = $keystone_username
} else {
$admin_user_real = $admin_user
}
if $keystone_password {
warning('The keystone_password parameter is deprecated. Use admin_password parameter instead')
$admin_password_real = $keystone_password
} else {
$admin_password_real = $admin_password
}
if $keystone_tenant {
warning('The keystone_tenant parameter is deprecated. Use admin_tenant_name parameter instead')
$admin_tenant_name_real = $keystone_tenant
} else {
$admin_tenant_name_real = $admin_tenant_name
}
if $keystone_url {
warning('The keystone_url parameter is deprecated. Use auth_uri parameter instead')
$auth_uri_real = $keystone_url
} else {
$auth_uri_real = $auth_uri
}
if $identity_url {
warning('The identity_url parameter is deprecated. Use identity_uri parameter instead')
$identity_uri_real = $identity_url
} else {
$identity_uri_real = $identity_uri
}
if $::osfamily == 'RedHat' {
$group_require = Package['sahara']
$dir_require = Package['sahara']
@ -216,25 +311,24 @@ class sahara(
sahara_config {
'DEFAULT/use_neutron': value => $use_neutron;
'DEFAULT/use_floating_ips': value => $use_floating_ips;
'DEFAULT/host': value => $service_host;
'DEFAULT/port': value => $service_port;
'DEFAULT/host': value => $host_real;
'DEFAULT/port': value => $port_real;
'DEFAULT/debug': value => $debug;
'DEFAULT/verbose': value => $verbose;
'DEFAULT/use_stderr': value => $use_stderr;
'database/connection':
value => $database_connection,
secret => true;
}
if $keystone_password {
if $admin_password_real {
sahara_config {
'keystone_authtoken/auth_uri': value => $keystone_url;
'keystone_authtoken/identity_uri': value => $identity_url;
'keystone_authtoken/admin_user': value => $keystone_username;
'keystone_authtoken/admin_tenant_name': value => $keystone_tenant;
'keystone_authtoken/auth_uri': value => $auth_uri_real;
'keystone_authtoken/identity_uri': value => $identity_uri_real;
'keystone_authtoken/admin_user': value => $admin_user_real;
'keystone_authtoken/admin_tenant_name': value => $admin_tenant_name_real;
'keystone_authtoken/admin_password':
value => $keystone_password,
value => $admin_password_real,
secret => true;
}
}
@ -251,12 +345,12 @@ class sahara(
if $use_syslog {
sahara_config {
'DEFAULT/use_syslog': value => true;
'DEFAULT/syslog_log_facility': value => $log_facility;
'DEFAULT/use_syslog': value => true;
'DEFAULT/syslog_log_facility': value => $log_facility;
}
} else {
sahara_config {
'DEFAULT/use_syslog': value => false;
'DEFAULT/use_syslog': value => false;
}
}

View File

@ -56,11 +56,13 @@
# (Optional) The default exchange to scope topics.
# Defaults to 'openstack'.
#
# == DEPRECATED PARAMETERS
#
# [*kombu_ssl_version*]
# (optional) SSL version to use (valid only if SSL enabled).
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
# available on some distributions.
# Defaults to 'TLSv1'
# Defaults to undef
#
# [*kombu_ssl_keyfile*]
# (Optional) SSL key file (valid only if SSL enabled).
@ -76,7 +78,7 @@
#
# [*kombu_reconnect_delay*]
# (Optional) Backoff on cancel notification (valid only if SSL enabled).
# Defaults to '1.0'; floating-point value.
# Defaults to undef
#
class sahara::notify::qpid(
$durable_queues = false,
@ -92,59 +94,52 @@ class sahara::notify::qpid(
$qpid_topology_version = 2,
$notification_topics = 'notifications',
$control_exchange = 'openstack',
$kombu_ssl_version = 'TLSv1',
# DEPRECATED PARAMETERS
$kombu_ssl_version = undef,
$kombu_ssl_keyfile = undef,
$kombu_ssl_certfile = undef,
$kombu_ssl_ca_certs = undef,
$kombu_reconnect_delay = '1.0',
$kombu_reconnect_delay = undef,
) {
if $qpid_protocol == 'ssl' {
if !$kombu_ssl_keyfile {
fail('kombu_ssl_keyfile must be set when using SSL in qpid')
}
if !$kombu_ssl_certfile {
fail('kombu_ssl_certfile must be set when using SSL in qpid')
}
if !$kombu_ssl_ca_certs {
fail('kombu_ca_certs must be set when using SSL in qpid')
}
sahara_config {
'DEFAULT/kombu_ssl_version': value => $kombu_ssl_version;
'DEFAULT/kombu_ssl_keyfile': value => $kombu_ssl_keyfile;
'DEFAULT/kombu_ssl_certfile': value => $kombu_ssl_certfile;
'DEFAULT/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs;
'DEFAULT/kombu_reconnect_delay': value => $kombu_reconnect_delay;
}
} elsif $qpid_protocol == 'tcp' {
sahara_config {
'DEFAULT/kombu_ssl_version': ensure => absent;
'DEFAULT/kombu_ssl_keyfile': ensure => absent;
'DEFAULT/kombu_ssl_certfile': ensure => absent;
'DEFAULT/kombu_ssl_ca_certs': ensure => absent;
'DEFAULT/kombu_reconnect_delay': ensure => absent;
}
} else {
fail("valid qpid_protocol settings are 'tcp' and 'ssl' only")
if $kombu_ssl_version {
warning('The kombu_ssl_version parameter is deprecated and has no effect.')
}
if $kombu_ssl_keyfile {
warning('The kombu_ssl_keyfile parameter is deprecated and has no effect.')
}
if $kombu_ssl_certfile {
warning('The kombu_ssl_certfile is deprecated and has no effect.')
}
if $kombu_ssl_ca_certs {
warning('The kombu_ssl_ca_certs is deprecated and has no effect.')
}
if $kombu_reconnect_delay {
warning('The kombu_reconnect_delay is deprecated and has no effect.')
}
sahara_config {
'DEFAULT/rpc_backend': value => 'qpid';
'DEFAULT/qpid_hosts': value => '$qpid_hostname:$qpid_port';
'DEFAULT/rpc_backend': value => 'qpid';
'oslo_messaging_qpid/qpid_hosts': value => '$qpid_hostname:$qpid_port';
'DEFAULT/amqp_durable_queues': value => $durable_queues;
'DEFAULT/qpid_hostname': value => $qpid_hostname;
'DEFAULT/qpid_port': value => $qpid_port;
'DEFAULT/qpid_username': value => $qpid_username;
'DEFAULT/qpid_password':
'oslo_messaging_qpid/amqp_durable_queues': value => $durable_queues;
'oslo_messaging_qpid/qpid_hostname': value => $qpid_hostname;
'oslo_messaging_qpid/qpid_port': value => $qpid_port;
'oslo_messaging_qpid/qpid_username': value => $qpid_username;
'oslo_messaging_qpid/qpid_password':
value => $qpid_password,
secret => true;
'DEFAULT/qpid_sasl_mechanisms': value => $qpid_sasl_mechanisms;
'DEFAULT/qpid_heartbeat': value => $qpid_heartbeat;
'DEFAULT/qpid_protocol': value => $qpid_protocol;
'DEFAULT/qpid_tcp_nodelay': value => $qpid_tcp_nodelay;
'DEFAULT/qpid_receiver_capacity': value => $qpid_receiver_capacity;
'DEFAULT/qpid_topology_version': value => $qpid_topology_version;
'DEFAULT/notification_topics': value => $notification_topics;
'DEFAULT/control_exchange': value => $control_exchange;
'oslo_messaging_qpid/qpid_sasl_mechanisms': value => $qpid_sasl_mechanisms;
'oslo_messaging_qpid/qpid_heartbeat': value => $qpid_heartbeat;
'oslo_messaging_qpid/qpid_protocol': value => $qpid_protocol;
'oslo_messaging_qpid/qpid_tcp_nodelay': value => $qpid_tcp_nodelay;
'oslo_messaging_qpid/qpid_receiver_capacity': value => $qpid_receiver_capacity;
'oslo_messaging_qpid/qpid_topology_version': value => $qpid_topology_version;
'DEFAULT/notification_topics': value => $notification_topics;
'DEFAULT/control_exchange': value => $control_exchange;
}
}

View File

@ -104,6 +104,7 @@ class sahara::notify::rabbitmq(
$kombu_ssl_ca_certs = undef,
$kombu_reconnect_delay = '1.0',
) {
if $rabbit_use_ssl {
if $kombu_ssl_ca_certs {
@ -125,9 +126,9 @@ class sahara::notify::rabbitmq(
}
if $kombu_ssl_version {
sahara_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $kombu_ssl_version; }
sahara_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $kombu_ssl_version; }
} else {
sahara_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
sahara_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
}
} else {
@ -154,20 +155,20 @@ class sahara::notify::rabbitmq(
}
sahara_config {
'oslo_messaging_rabbit/rpc_backend': value => 'rabbit';
'DEFAULT/amqp_durable_queues': value => $durable_queues;
'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl;
'oslo_messaging_rabbit/rabbit_userid': value => $rabbit_userid;
'DEFAULT/rpc_backend': value => 'rabbit';
'oslo_messaging_rabbit/amqp_durable_queues': value => $durable_queues;
'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl;
'oslo_messaging_rabbit/rabbit_userid': value => $rabbit_userid;
'oslo_messaging_rabbit/rabbit_password':
value => $rabbit_password,
secret => true;
'oslo_messaging_rabbit/rabbit_login_method': value => $rabbit_login_method;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_login_method': value => $rabbit_login_method;
'oslo_messaging_rabbit/rabbit_virtual_host': value => $rabbit_virtual_host;
'oslo_messaging_rabbit/rabbit_retry_interval': value => $rabbit_retry_interval;
'oslo_messaging_rabbit/rabbit_retry_backoff': value => $rabbit_retry_backoff;
'oslo_messaging_rabbit/rabbit_max_retries': value => $rabbit_max_retries;
'DEFAULT/notification_topics': value => $notification_topics;
'DEFAULT/control_exchange': value => $control_exchange;
'oslo_messaging_rabbit/rabbit_retry_backoff': value => $rabbit_retry_backoff;
'oslo_messaging_rabbit/rabbit_max_retries': value => $rabbit_max_retries;
'DEFAULT/notification_topics': value => $notification_topics;
'DEFAULT/control_exchange': value => $control_exchange;
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $kombu_reconnect_delay;
}
}

View File

@ -32,11 +32,13 @@
# (Optional) TTL for zeromq messages.
# Defaults to 30.
#
# == DEPRECATED PARAMETERS
#
# [*kombu_ssl_version*]
# (optional) SSL version to use (valid only if SSL enabled).
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
# available on some distributions.
# Defaults to 'TLSv1'
# Defaults to undef
#
# [*kombu_ssl_keyfile*]
# (Optional) SSL key file (valid only if SSL enabled).
@ -52,7 +54,7 @@
#
# [*kombu_reconnect_delay*]
# (Optional) Backoff on cancel notification (valid only if SSL enabled).
# Defaults to '1.0'; floating-point value.
# Defaults to undef
#
class sahara::notify::zeromq(
$zeromq_bind_address = '*',
@ -62,47 +64,42 @@ class sahara::notify::zeromq(
$zeromq_ipc_dir = '/var/run/openstack',
$zeromq_host = 'sahara',
$cast_timeout = 30,
$kombu_ssl_version = 'TLSv1',
# DEPRECATED PARAMETERS
$kombu_ssl_version = undef,
$kombu_ssl_keyfile = undef,
$kombu_ssl_certfile = undef,
$kombu_ssl_ca_certs = undef,
$kombu_reconnect_delay = '1.0',
$kombu_reconnect_delay = undef,
) {
if $kombu_ssl_keyfile or $kombu_ssl_certfile or $kombu_ssl_ca_certs {
if !$kombu_ssl_keyfile {
fail('kombu_ssl_keyfile must be set when using SSL in zeromq')
}
if !$kombu_ssl_certfile {
fail('kombu_ssl_certfile must be set when using SSL in zeromq')
}
if !$kombu_ssl_ca_certs {
fail('kombu_ca_certs must be set when using SSL in zeromq')
}
sahara_config {
'DEFAULT/kombu_ssl_version': value => $kombu_ssl_version;
'DEFAULT/kombu_ssl_keyfile': value => $kombu_ssl_keyfile;
'DEFAULT/kombu_ssl_certfile': value => $kombu_ssl_certfile;
'DEFAULT/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs;
'DEFAULT/kombu_reconnect_delay': value => $kombu_reconnect_delay;
}
} else {
sahara_config {
'DEFAULT/kombu_ssl_version': ensure => absent;
'DEFAULT/kombu_ssl_keyfile': ensure => absent;
'DEFAULT/kombu_ssl_certfile': ensure => absent;
'DEFAULT/kombu_ssl_ca_certs': ensure => absent;
'DEFAULT/kombu_reconnect_delay': ensure => absent;
}
if $kombu_ssl_version {
warning('The kombu_ssl_version parameter is deprecated and has no effect.')
}
if $kombu_ssl_keyfile {
warning('The kombu_ssl_keyfile parameter is deprecated and has no effect.')
}
if $kombu_ssl_certfile {
warning('The kombu_ssl_certfile is deprecated and has no effect.')
}
if $kombu_ssl_ca_certs {
warning('The kombu_ssl_ca_certs is deprecated and has no effect.')
}
if $kombu_reconnect_delay {
warning('The kombu_reconnect_delay is deprecated and has no effect.')
}
sahara_config {
'DEFAULT/rpc_backend': value => 'zmq';
'DEFAULT/rpc_zmq_bind_address': value => $zeromq_bind_address;
'DEFAULT/rpc_zmq_port': value => $zeromq_port;
'DEFAULT/rpc_zmq_contexts': value => $zeromq_contexts;
'DEFAULT/rpc_backend': value => 'zmq';
'DEFAULT/rpc_zmq_bind_address': value => $zeromq_bind_address;
'DEFAULT/rpc_zmq_port': value => $zeromq_port;
'DEFAULT/rpc_zmq_contexts': value => $zeromq_contexts;
'DEFAULT/rpc_zmq_topic_backlog': value => $zeromq_topic_backlog;
'DEFAULT/rpc_zmq_ipc_dir': value => $zeromq_ipc_dir;
'DEFAULT/rpc_zmq_host': value => $zeromq_host;
'DEFAULT/rpc_cast_timeout': value => $cast_timeout;
'DEFAULT/rpc_zmq_ipc_dir': value => $zeromq_ipc_dir;
'DEFAULT/rpc_zmq_host': value => $zeromq_host;
'DEFAULT/rpc_cast_timeout': value => $cast_timeout;
}
}

View File

@ -80,7 +80,7 @@ describe 'basic sahara' do
# Sahara resources
class { '::sahara':
database_connection => 'mysql://sahara:a_big_secret@127.0.0.1/sahara?charset=utf8',
keystone_password => 'a_big_secret',
admin_password => 'a_big_secret',
}
class { '::sahara::db::mysql':
password => 'a_big_secret',

View File

@ -7,7 +7,7 @@ describe 'sahara' do
let :params do
{
:keystone_password => 'secrete'
:admin_password => 'secrete'
}
end
@ -18,6 +18,64 @@ describe 'sahara' do
it { is_expected.to contain_exec('sahara-dbmanage') }
end
shared_examples_for 'sahara config' do
context 'with default params' do
it { is_expected.to contain_sahara_config('DEFAULT/use_neutron').with_value('false') }
it { is_expected.to contain_sahara_config('DEFAULT/use_floating_ips').with_value('true') }
it { is_expected.to contain_sahara_config('DEFAULT/host').with_value('0.0.0.0') }
it { is_expected.to contain_sahara_config('DEFAULT/port').with_value('8386') }
it { is_expected.to contain_sahara_config('keystone_authtoken/auth_uri').with_value('http://127.0.0.1:5000/v2.0/') }
it { is_expected.to contain_sahara_config('keystone_authtoken/identity_uri').with_value('http://127.0.0.1:35357/') }
it { is_expected.to contain_sahara_config('keystone_authtoken/admin_user').with_value('admin') }
it { is_expected.to contain_sahara_config('keystone_authtoken/admin_tenant_name').with_value('admin') }
it { is_expected.to contain_sahara_config('keystone_authtoken/admin_password').with_value('secrete').with_secret(true) }
end
context 'with passing params' do
let :params do {
:use_neutron => 'true',
:host => 'localhost',
:port => '8387',
:auth_uri => 'http://8.8.8.8:5000/v2.0/',
:identity_uri => 'http://8.8.8.8:35357/',
:admin_user => 'sahara',
:admin_tenant_name => 'sahara-tenant',
:admin_password => 'new_password',
}
end
it { is_expected.to contain_sahara_config('DEFAULT/use_neutron').with_value('true') }
it { is_expected.to contain_sahara_config('DEFAULT/host').with_value('localhost') }
it { is_expected.to contain_sahara_config('DEFAULT/port').with_value('8387') }
it { is_expected.to contain_sahara_config('keystone_authtoken/auth_uri').with_value('http://8.8.8.8:5000/v2.0/') }
it { is_expected.to contain_sahara_config('keystone_authtoken/identity_uri').with_value('http://8.8.8.8:35357/') }
it { is_expected.to contain_sahara_config('keystone_authtoken/admin_user').with_value('sahara') }
it { is_expected.to contain_sahara_config('keystone_authtoken/admin_tenant_name').with_value('sahara-tenant') }
it { is_expected.to contain_sahara_config('keystone_authtoken/admin_password').with_value('new_password').with_secret(true) }
end
context 'with deprecated params' do
let :params do {
:service_host => 'localhost',
:service_port => '8387',
:keystone_url => 'http://8.8.8.8:5000/v2.0/',
:identity_url => 'http://8.8.8.8:35357/',
:keystone_username => 'sahara',
:keystone_tenant => 'sahara-tenant',
:keystone_password => 'new_password',
}
end
it { is_expected.to contain_sahara_config('DEFAULT/host').with_value('localhost') }
it { is_expected.to contain_sahara_config('DEFAULT/port').with_value('8387') }
it { is_expected.to contain_sahara_config('keystone_authtoken/auth_uri').with_value('http://8.8.8.8:5000/v2.0/') }
it { is_expected.to contain_sahara_config('keystone_authtoken/identity_uri').with_value('http://8.8.8.8:35357/') }
it { is_expected.to contain_sahara_config('keystone_authtoken/admin_user').with_value('sahara') }
it { is_expected.to contain_sahara_config('keystone_authtoken/admin_tenant_name').with_value('sahara-tenant') }
it { is_expected.to contain_sahara_config('keystone_authtoken/admin_password').with_value('new_password').with_secret(true) }
end
end
shared_examples_for 'sahara logging' do
context 'with use_stderr enabled' do
it { is_expected.to contain_sahara_config('DEFAULT/use_stderr').with_value(true) }
@ -118,6 +176,7 @@ describe 'sahara' do
end
it_configures 'sahara'
it_configures 'sahara config'
it_configures 'sahara logging'
it_configures 'sahara ssl'
@ -133,6 +192,7 @@ describe 'sahara' do
end
it_configures 'sahara'
it_configures 'sahara config'
it_configures 'sahara logging'
it_configures 'sahara ssl'

View File

@ -11,12 +11,12 @@ describe 'sahara::notify::qpid' do
{:qpid_password => 'pass'}
end
it { is_expected.to contain_sahara_config('DEFAULT/qpid_username').with_value('guest') }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_password').with_value('pass') }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_password').with_value(params[:qpid_password]).with_secret(true) }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_hostname').with_value('localhost') }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_port').with_value('5672') }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_protocol').with_value('tcp') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_username').with_value('guest') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_password').with_value('pass') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_password').with_value(params[:qpid_password]).with_secret(true) }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_hostname').with_value('localhost') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_port').with_value('5672') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_protocol').with_value('tcp') }
end
describe 'when passing params' do
@ -28,10 +28,10 @@ describe 'sahara::notify::qpid' do
:qpid_port => '5673'
}
end
it { is_expected.to contain_sahara_config('DEFAULT/qpid_username').with_value('guest2') }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_hostname').with_value('localhost2') }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_port').with_value('5673') }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_protocol').with_value('tcp') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_username').with_value('guest2') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_hostname').with_value('localhost2') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_port').with_value('5673') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_protocol').with_value('tcp') }
end
describe 'when configuring with ssl' do
@ -42,17 +42,11 @@ describe 'sahara::notify::qpid' do
:qpid_hostname => 'localhost3',
:qpid_port => '5671',
:qpid_protocol => 'ssl',
:kombu_ssl_keyfile => '/srv/sahara_ssl.key',
:kombu_ssl_certfile => '/srv/sahara_ssl.crt',
:kombu_ssl_ca_certs => '/srv/cacert',
}
end
it { is_expected.to contain_sahara_config('DEFAULT/qpid_username').with_value('guest3') }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_hostname').with_value('localhost3') }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_port').with_value('5671') }
it { is_expected.to contain_sahara_config('DEFAULT/qpid_protocol').with_value('ssl') }
it { is_expected.to contain_sahara_config('DEFAULT/kombu_ssl_keyfile').with_value('/srv/sahara_ssl.key') }
it { is_expected.to contain_sahara_config('DEFAULT/kombu_ssl_certfile').with_value('/srv/sahara_ssl.crt') }
it { is_expected.to contain_sahara_config('DEFAULT/kombu_ssl_ca_certs').with_value('/srv/cacert') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_username').with_value('guest3') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_hostname').with_value('localhost3') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_port').with_value('5671') }
it { is_expected.to contain_sahara_config('oslo_messaging_qpid/qpid_protocol').with_value('ssl') }
end
end

View File

@ -17,7 +17,7 @@ describe 'sahara::notify::rabbitmq' do
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_port').with_value('5672') }
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_hosts').with_value('localhost:5672') }
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') }
it { is_expected.to contain_sahara_config('DEFAULT/amqp_durable_queues').with_value('false') }
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('false') }
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('/') }
it { is_expected.to contain_sahara_config('DEFAULT/control_exchange').with_value('openstack') }
it { is_expected.to contain_sahara_config('DEFAULT/notification_topics').with_value('notifications') }
@ -101,7 +101,7 @@ describe 'sahara::notify::rabbitmq' do
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_host').with_value('localhost2') }
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_port').with_value('5673') }
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_hosts').with_value('localhost2:5673') }
it { is_expected.to contain_sahara_config('DEFAULT/amqp_durable_queues').with_value('true') }
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true') }
end
describe 'when passing params for multiple rabbit hosts' do
@ -120,13 +120,4 @@ describe 'sahara::notify::rabbitmq' do
it { is_expected.to_not contain_sahara_config('oslo_messaging_rabbit/rabbit_host') }
end
describe 'when using deprecated params' do
let :params do
{
:durable_queues => true,
:rabbit_password => 'pass'
}
end
it { is_expected.to contain_sahara_config('DEFAULT/amqp_durable_queues').with_value('true') }
end
end