Update bigswitch restproxy configuration

Update the restproxy configuration to use $::os_service_default for
values that match the upstream configuration defaults. Additionally add
the ability to configure cache_connections, keystone_sync_interval,
no_ssl_validation, server_timeout, sync_data and thread_pool_size.

Change-Id: I24e48c1ca7d35f67f786c4751c7cdf4954f65377
This commit is contained in:
Alex Schultz 2017-03-21 13:32:13 -06:00
parent 671cd47cf5
commit a05516901f
3 changed files with 129 additions and 58 deletions

View File

@ -7,31 +7,12 @@
# [*servers*]
# Comma-separated list of Big Switch controllers.
# The format is "IP:port,IP:port".
# Defaults to $::os_service_default
#
# [*server_auth*]
# Credentials for the Big Switch controllers.
# The format is "username:password".
#
# [*auto_sync_on_failure*]
# (optional) When a failover happens in active/passive Big Switch
# controllers, resynchronize with the new master server. Defaults to
# true.
#
# [*consistency_interval*]
# (optional) Interval of a keepalive message sent from Neutron server
# to a Big Switch controller. Defaults to 60.
#
# [*neutron_id*]
# (optional) Unique identifier of the Neutron instance for the Big
# Switch controller. Defaults to 'neutron'.
#
# [*server_ssl*]
# (optional) Whether Neutron should use SSL to talk to the Big Switch
# controllers. Defaults to true.
#
# [*ssl_cert_directory*]
# (optional) Directory where Big Switch controller certificate will be
# stored. Defaults to '/var/lib/neutron'.
# Defaults to $::os_service_default
#
# [*auth_tenant*]
# (optional) The tenant of the auth user
@ -49,20 +30,74 @@
# (optional) Complete public Identity API endpoint.
# Defaults to: false
#
# [*auto_sync_on_failure*]
# (optional) When a failover happens in active/passive Big Switch
# controllers, resynchronize with the new master server. Defaults to
# true.
# Defaults to $::os_service_default
#
# [*cache_connections*]
# (optional) Re-use HTTP/HTTPS connections to the controller.
# Defaults to $::os_service_default
#
# [*consistency_interval*]
# (optional) Interval of a keepalive message sent from Neutron server
# to a Big Switch controller..
# Defaults to $::os_service_default
#
# [*keystone_sync_interval*]
# (optional) Time between openstack tenant sync queries
# Defaults to $::os_service_default
#
# [*neutron_id*]
# (optional) Unique identifier of the Neutron instance for the Big
# Switch controller. Defaults to 'neutron'.
#
# [*no_ssl_validation*]
# (optional) Disables SSL certificate validaiton for controllers
# Defaults to $::os_service_default
#
# [*server_ssl*]
# (optional) Whether Neutron should use SSL to talk to the Big Switch
# controllers.
# Defaults to $::os_service_default
#
# [*server_timeout*]
# (optional) Maximum number of seconds to wait for proxy request to connect
# and complete.
# Defaults to $::os_service_default
#
# [*ssl_cert_directory*]
# (optional) Directory where Big Switch controller certificate will be
# stored. Defaults to '/var/lib/neutron'.
#
# [*sync_data*]
# (optional) Sync data on connect
# Defaults to $::os_service_default
#
# [*thread_pool_size*]
# (optional) Maximum number of threads to spawn to handle large volumes of
# port creations.
# Defaults to $::os_service_default
#
class neutron::plugins::ml2::bigswitch::restproxy (
$servers,
$server_auth,
$auto_sync_on_failure = true,
$consistency_interval = 60,
$neutron_id = 'neutron',
$server_ssl = true,
$ssl_cert_directory = '/var/lib/neutron',
$auth_tenant = 'service',
$auth_password = false,
$auth_user = 'neutron',
$auth_url = false,
$servers = $::os_service_default,
$server_auth = $::os_service_default,
$auth_tenant = 'service',
$auth_password = false,
$auth_user = 'neutron',
$auth_url = false,
$auto_sync_on_failure = $::os_service_default,
$cache_connections = $::os_service_default,
$consistency_interval = $::os_service_default,
$keystone_sync_interval = $::os_service_default,
$neutron_id = 'neutron',
$no_ssl_validation = $::os_service_default,
$server_ssl = $::os_service_default,
$server_timeout = $::os_service_default,
$ssl_cert_directory = '/var/lib/neutron',
$sync_data = $::os_service_default,
$thread_pool_size = $::os_service_default,
) {
include ::neutron::deps
@ -71,16 +106,20 @@ class neutron::plugins::ml2::bigswitch::restproxy (
neutron_plugin_ml2 {
'restproxy/servers' : value => $servers;
'restproxy/server_auth' : value => $server_auth;
'restproxy/auto_sync_on_failure' : value => $auto_sync_on_failure;
'restproxy/consistency_interval' : value => $consistency_interval;
'restproxy/neutron_id' : value => $neutron_id;
'restproxy/server_ssl' : value => $server_ssl;
'restproxy/ssl_cert_directory' : value => $ssl_cert_directory;
'restproxy/auth_tenant' : value => $auth_tenant;
'restproxy/auth_password' : value => $auth_password, secret => true;
'restproxy/auth_user' : value => $auth_user;
'restproxy/auth_url' : value => $auth_url;
'restproxy/auto_sync_on_failure' : value => $auto_sync_on_failure;
'restproxy/cache_connections' : value => $cache_connections;
'restproxy/consistency_interval' : value => $consistency_interval;
'restproxy/keystone_sync_interval': value => $keystone_sync_interval;
'restproxy/neutron_id' : value => $neutron_id;
'restproxy/no_ssl_validation' : value => $no_ssl_validation;
'restproxy/server_ssl' : value => $server_ssl;
'restproxy/server_timeout' : value => $server_timeout;
'restproxy/ssl_cert_directory' : value => $ssl_cert_directory;
'restproxy/sync_data' : value => $sync_data;
'restproxy/thread_pool_size' : value => $thread_pool_size;
}
}

View File

@ -0,0 +1,13 @@
---
features:
- |
Added additional configuration parameters for the bigswitch restproxy
plugin configuration. Added the ability to configure `cache_connections`,
`keystone_sync_interval`, `no_Ssl_validation, `server_timeout`,
`sync_data`, and `thread_pool_size`
upgrade:
- |
Switched the bigswitch restproxy configuration to use $::os_service_default
for parameters that match the upstream default. It should be noted that
the default values for `ssl_cert_directory` and `neutron_id` do not match
the defaults from the networking-bigswitch classes and have been left alone.

View File

@ -41,41 +41,60 @@ describe 'neutron::plugins::ml2::bigswitch::restproxy' do
it do
is_expected.to contain_neutron_plugin_ml2('restproxy/servers').with_value(params[:servers])
is_expected.to contain_neutron_plugin_ml2('restproxy/server_auth').with_value(params[:server_auth])
is_expected.to contain_neutron_plugin_ml2('restproxy/auto_sync_on_failure').with_value(true)
is_expected.to contain_neutron_plugin_ml2('restproxy/consistency_interval').with_value(60)
is_expected.to contain_neutron_plugin_ml2('restproxy/neutron_id').with_value('neutron')
is_expected.to contain_neutron_plugin_ml2('restproxy/server_ssl').with_value(true)
is_expected.to contain_neutron_plugin_ml2('restproxy/ssl_cert_directory').with_value('/var/lib/neutron')
is_expected.to contain_neutron_plugin_ml2('restproxy/auth_tenant').with_value('service')
is_expected.to contain_neutron_plugin_ml2('restproxy/auth_password').with_value(false)
is_expected.to contain_neutron_plugin_ml2('restproxy/auth_user').with_value('neutron')
is_expected.to contain_neutron_plugin_ml2('restproxy/auth_url').with_value(false)
is_expected.to contain_neutron_plugin_ml2('restproxy/auto_sync_on_failure').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_plugin_ml2('restproxy/cache_connections').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_plugin_ml2('restproxy/consistency_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_plugin_ml2('restproxy/keystone_sync_interval').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_plugin_ml2('restproxy/neutron_id').with_value('neutron')
is_expected.to contain_neutron_plugin_ml2('restproxy/no_ssl_validation').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_plugin_ml2('restproxy/server_ssl').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_plugin_ml2('restproxy/server_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_plugin_ml2('restproxy/ssl_cert_directory').with_value('/var/lib/neutron')
is_expected.to contain_neutron_plugin_ml2('restproxy/sync_data').with_value('<SERVICE DEFAULT>')
is_expected.to contain_neutron_plugin_ml2('restproxy/thread_pool_size').with_value('<SERVICE DEFAULT>')
end
context 'with custom params' do
let :params do
required_params.merge({
:auto_sync_on_failure => false,
:consistency_interval => 10,
:neutron_id => 'openstack',
:server_ssl => false,
:ssl_cert_directory => '/var/lib/bigswitch',
:auto_sync_on_failure => false,
:cache_connections => true,
:consistency_interval => 10,
:keystone_sync_interval => 10,
:neutron_id => 'openstack',
:no_ssl_validation => true,
:server_ssl => false,
:server_timeout => 30,
:ssl_cert_directory => '/var/lib/bigswitch',
:sync_data => true,
:thread_pool_size => 8,
})
end
it do
is_expected.to contain_neutron_plugin_ml2('restproxy/auto_sync_on_failure').with_value(false)
is_expected.to contain_neutron_plugin_ml2('restproxy/consistency_interval').with_value(10)
is_expected.to contain_neutron_plugin_ml2('restproxy/neutron_id').with_value('openstack')
is_expected.to contain_neutron_plugin_ml2('restproxy/server_ssl').with_value(false)
is_expected.to contain_neutron_plugin_ml2('restproxy/ssl_cert_directory').with_value('/var/lib/bigswitch')
is_expected.to contain_neutron_plugin_ml2('restproxy/servers').with_value(params[:servers])
is_expected.to contain_neutron_plugin_ml2('restproxy/server_auth').with_value(params[:server_auth])
is_expected.to contain_neutron_plugin_ml2('restproxy/auth_tenant').with_value('service')
is_expected.to contain_neutron_plugin_ml2('restproxy/auth_password').with_value(false)
is_expected.to contain_neutron_plugin_ml2('restproxy/auth_user').with_value('neutron')
is_expected.to contain_neutron_plugin_ml2('restproxy/auth_url').with_value(false)
is_expected.to contain_neutron_plugin_ml2('restproxy/auto_sync_on_failure').with_value(false)
is_expected.to contain_neutron_plugin_ml2('restproxy/cache_connections').with_value(true)
is_expected.to contain_neutron_plugin_ml2('restproxy/consistency_interval').with_value(10)
is_expected.to contain_neutron_plugin_ml2('restproxy/keystone_sync_interval').with_value(10)
is_expected.to contain_neutron_plugin_ml2('restproxy/neutron_id').with_value('openstack')
is_expected.to contain_neutron_plugin_ml2('restproxy/no_ssl_validation').with_value(true)
is_expected.to contain_neutron_plugin_ml2('restproxy/server_ssl').with_value(false)
is_expected.to contain_neutron_plugin_ml2('restproxy/server_timeout').with_value(30)
is_expected.to contain_neutron_plugin_ml2('restproxy/ssl_cert_directory').with_value('/var/lib/bigswitch')
is_expected.to contain_neutron_plugin_ml2('restproxy/sync_data').with_value(true)
is_expected.to contain_neutron_plugin_ml2('restproxy/thread_pool_size').with_value(8)
end
end