Add support for single tenant mode
Single tenant mode creates all DBaaS resources in a given tenant, rather than the default, which is to use the users own tenant. It relies on the nova_proxy_admin_* vars for this. This commit adds a new trove::single_tenant_mode variable, when set to true, sets up the remote_(nova|cinder|neutron)_client config vars in the each of the config files for this mode to be enabled. Change-Id: Ic59bd227fff893c705931ced3add636844533d35
This commit is contained in:
parent
86acd8bac2
commit
7fdbe6e50c
@ -159,6 +159,21 @@ class trove::api(
|
||||
'DEFAULT/nova_proxy_admin_tenant_name': value => $::trove::nova_proxy_admin_tenant_name;
|
||||
}
|
||||
|
||||
if $::trove::single_tenant_mode {
|
||||
trove_config {
|
||||
'DEFAULT/remote_nova_client': value => 'trove.common.single_tenant_remote.nova_client_trove_admin';
|
||||
'DEFAULT/remote_cinder_client': value => 'trove.common.single_tenant_remote.cinder_client_trove_admin';
|
||||
'DEFAULT/remote_neutron_client': value => 'trove.common.single_tenant_remote.neutron_client_trove_admin';
|
||||
}
|
||||
}
|
||||
else {
|
||||
trove_config {
|
||||
'DEFAULT/remote_nova_client': ensure => absent;
|
||||
'DEFAULT/remote_cinder_client': ensure => absent;
|
||||
'DEFAULT/remote_neutron_client': ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
oslo::messaging::default { 'trove_config':
|
||||
transport_url => $::trove::default_transport_url,
|
||||
control_exchange => $::trove::control_exchange,
|
||||
|
@ -108,6 +108,21 @@ class trove::conductor(
|
||||
'profiler/trace_sqlalchemy': value => $trace_sqlalchemy;
|
||||
}
|
||||
|
||||
if $::trove::single_tenant_mode {
|
||||
trove_conductor_config {
|
||||
'DEFAULT/remote_nova_client': value => 'trove.common.single_tenant_remote.nova_client_trove_admin';
|
||||
'DEFAULT/remote_cinder_client': value => 'trove.common.single_tenant_remote.cinder_client_trove_admin';
|
||||
'DEFAULT/remote_neutron_client': value => 'trove.common.single_tenant_remote.neutron_client_trove_admin';
|
||||
}
|
||||
}
|
||||
else {
|
||||
trove_conductor_config {
|
||||
'DEFAULT/remote_nova_client': ensure => absent;
|
||||
'DEFAULT/remote_cinder_client': ensure => absent;
|
||||
'DEFAULT/remote_neutron_client': ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
oslo::messaging::default { 'trove_conductor_config':
|
||||
transport_url => $::trove::default_transport_url,
|
||||
control_exchange => $::trove::control_exchange,
|
||||
|
@ -181,6 +181,11 @@
|
||||
# (optional) If set, use this value for max_overflow with sqlalchemy.
|
||||
# Defaults to: undef.
|
||||
#
|
||||
# [*single_tenant_mode*]
|
||||
# (optional) If set to true, will configure Trove to work in single
|
||||
# tenant mode.
|
||||
# Defaults to false.
|
||||
#
|
||||
# [*nova_compute_url*]
|
||||
# (optional) URL without the tenant segment.
|
||||
# Defaults to false.
|
||||
@ -321,6 +326,7 @@ class trove(
|
||||
$database_min_pool_size = undef,
|
||||
$database_max_pool_size = undef,
|
||||
$database_max_overflow = undef,
|
||||
$single_tenant_mode = false,
|
||||
$rpc_backend = 'rabbit',
|
||||
$nova_compute_url = false,
|
||||
$nova_proxy_admin_user = 'admin',
|
||||
|
@ -160,6 +160,21 @@ class trove::taskmanager(
|
||||
'DEFAULT/heat_service_type': value => $::trove::heat_service_type;
|
||||
}
|
||||
|
||||
if $::trove::single_tenant_mode {
|
||||
trove_taskmanager_config {
|
||||
'DEFAULT/remote_nova_client': value => 'trove.common.single_tenant_remote.nova_client_trove_admin';
|
||||
'DEFAULT/remote_cinder_client': value => 'trove.common.single_tenant_remote.cinder_client_trove_admin';
|
||||
'DEFAULT/remote_neutron_client': value => 'trove.common.single_tenant_remote.neutron_client_trove_admin';
|
||||
}
|
||||
}
|
||||
else {
|
||||
trove_taskmanager_config {
|
||||
'DEFAULT/remote_nova_client': ensure => absent;
|
||||
'DEFAULT/remote_cinder_client': ensure => absent;
|
||||
'DEFAULT/remote_neutron_client': ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
oslo::messaging::default { 'trove_taskmanager_config':
|
||||
transport_url => $::trove::default_transport_url,
|
||||
control_exchange => $::trove::control_exchange,
|
||||
|
@ -0,0 +1,3 @@
|
||||
---
|
||||
features:
|
||||
- Add support for enabling single tenant mode
|
@ -81,6 +81,9 @@ describe 'trove::api' do
|
||||
is_expected.to contain_trove_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_trove_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_trove_config('DEFAULT/control_exchange').with_value('trove')
|
||||
is_expected.to contain_trove_config('DEFAULT/remote_nova_client').with_ensure('absent')
|
||||
is_expected.to contain_trove_config('DEFAULT/remote_cinder_client').with_ensure('absent')
|
||||
is_expected.to contain_trove_config('DEFAULT/remote_neutron_client').with_ensure('absent')
|
||||
is_expected.to contain_trove_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_trove_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_trove_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>')
|
||||
@ -130,6 +133,22 @@ describe 'trove::api' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'with single tenant mode enabled' do
|
||||
let :pre_condition do
|
||||
"class { 'trove':
|
||||
nova_proxy_admin_pass => 'verysecrete',
|
||||
single_tenant_mode => 'true'}
|
||||
class { '::trove::keystone::authtoken':
|
||||
password => 'a_big_secret',
|
||||
}"
|
||||
end
|
||||
it 'single tenant client values are set' do
|
||||
is_expected.to contain_trove_config('DEFAULT/remote_nova_client').with_value('trove.common.single_tenant_remote.nova_client_trove_admin')
|
||||
is_expected.to contain_trove_config('DEFAULT/remote_cinder_client').with_value('trove.common.single_tenant_remote.cinder_client_trove_admin')
|
||||
is_expected.to contain_trove_config('DEFAULT/remote_neutron_client').with_value('trove.common.single_tenant_remote.neutron_client_trove_admin')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when using a single RabbitMQ server' do
|
||||
let :pre_condition do
|
||||
"class { 'trove':
|
||||
|
@ -37,6 +37,9 @@ describe 'trove::conductor' do
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/control_exchange').with_value('trove')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/remote_nova_client').with_ensure('absent')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/remote_cinder_client').with_ensure('absent')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/remote_neutron_client').with_ensure('absent')
|
||||
is_expected.to contain_trove_conductor_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>')
|
||||
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('<SERVICE DEFAULT>')
|
||||
@ -48,6 +51,22 @@ describe 'trove::conductor' do
|
||||
is_expected.to contain_trove_conductor_config('profiler/trace_sqlalchemy').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
|
||||
context 'with single tenant mode enabled' do
|
||||
let :pre_condition do
|
||||
"class { 'trove':
|
||||
nova_proxy_admin_pass => 'verysecrete',
|
||||
single_tenant_mode => 'true'}
|
||||
class { '::trove::keystone::authtoken':
|
||||
password => 'a_big_secret',
|
||||
}"
|
||||
end
|
||||
it 'single tenant client values are set' do
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/remote_nova_client').with_value('trove.common.single_tenant_remote.nova_client_trove_admin')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/remote_cinder_client').with_value('trove.common.single_tenant_remote.cinder_client_trove_admin')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/remote_neutron_client').with_value('trove.common.single_tenant_remote.neutron_client_trove_admin')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when using a single RabbitMQ server' do
|
||||
let :pre_condition do
|
||||
"class { 'trove':
|
||||
|
@ -73,6 +73,9 @@ describe 'trove::taskmanager' do
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/control_exchange').with_value('trove')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/remote_nova_client').with_ensure('absent')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/remote_cinder_client').with_ensure('absent')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/remote_neutron_client').with_ensure('absent')
|
||||
is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>')
|
||||
@ -98,6 +101,22 @@ describe 'trove::taskmanager' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'with single tenant mode enabled' do
|
||||
let :pre_condition do
|
||||
"class { 'trove':
|
||||
nova_proxy_admin_pass => 'verysecrete',
|
||||
single_tenant_mode => 'true'}
|
||||
class { '::trove::keystone::authtoken':
|
||||
password => 'a_big_secret',
|
||||
}"
|
||||
end
|
||||
it 'single tenant client values are set' do
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/remote_nova_client').with_value('trove.common.single_tenant_remote.nova_client_trove_admin')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/remote_cinder_client').with_value('trove.common.single_tenant_remote.cinder_client_trove_admin')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/remote_neutron_client').with_value('trove.common.single_tenant_remote.neutron_client_trove_admin')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when using a single RabbitMQ server' do
|
||||
let :pre_condition do
|
||||
"class { 'trove':
|
||||
|
Loading…
Reference in New Issue
Block a user