Support Neutron

The network driver and network label regex need to be set properly
for neutron to work.

Change-Id: I9e24ea252f434209ebc2fce89727db9bae2d1c1e
This commit is contained in:
Solly Ross 2014-12-16 15:42:00 -05:00
parent 1b43832a1b
commit c345e128c7
3 changed files with 71 additions and 0 deletions

View File

@ -140,6 +140,10 @@
# (optional) Control exchange.
# Defaults to 'trove'.
#
# [*use_neutron*]
# (optional) Use Neutron
# Defaults to true
#
class trove(
$nova_proxy_admin_pass,
$rabbit_host = 'localhost',
@ -164,6 +168,7 @@ class trove(
$control_exchange = 'trove',
$cinder_url = false,
$swift_url = false,
$use_neutron = true,
# DEPRECATED PARAMETERS
$mysql_module = undef,
) {

View File

@ -170,6 +170,32 @@ class trove::taskmanager(
}
}
if $::trove::use_neutron {
trove_config {
'DEFAULT/network_label_regex': value => '.*';
'DEFAULT/network_driver': value => 'trove.network.neutron.NeutronDriver';
}
trove_taskmanager_config {
'DEFAULT/network_label_regex': value => '.*';
'DEFAULT/network_driver': value => 'trove.network.neutron.NeutronDriver';
}
} else {
trove_config {
'DEFAULT/network_label_regex': value => '^private$';
'DEFAULT/network_driver': value => 'trove.network.nova.NovaNetwork';
}
trove_taskmanager_config {
'DEFAULT/network_label_regex': value => '^private$';
'DEFAULT/network_driver': value => 'trove.network.nova.NovaNetwork';
}
}
trove_config {
'DEFAULT/taskmanager_queue': value => 'taskmanager';
}
# Logging
if $log_file {
trove_taskmanager_config {

View File

@ -84,6 +84,46 @@ describe 'trove::taskmanager' do
should contain_trove_taskmanager_config('DEFAULT/sql_connection').with_value('mysql://trove:pass@10.0.0.1/trove')
end
end
context 'when using Neutron' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
use_neutron => true}"
end
it 'configures trove to use the Neutron network driver' do
should contain_trove_config('DEFAULT/network_driver').with_value('trove.network.neutron.NeutronDriver')
should contain_trove_taskmanager_config('DEFAULT/network_driver').with_value('trove.network.neutron.NeutronDriver')
end
it 'configures trove to use any network label' do
should contain_trove_config('DEFAULT/network_label_regex').with_value('.*')
should contain_trove_taskmanager_config('DEFAULT/network_label_regex').with_value('.*')
end
end
context 'when using Nova Network' do
let :pre_condition do
"class { 'trove':
nova_proxy_admin_pass => 'verysecrete',
use_neutron => false}"
end
it 'configures trove to use the Nova Network network driver' do
should contain_trove_config('DEFAULT/network_driver').with_value('trove.network.nova.NovaNetwork')
should contain_trove_taskmanager_config('DEFAULT/network_driver').with_value('trove.network.nova.NovaNetwork')
end
it 'configures trove to use the "private" network label' do
should contain_trove_config('DEFAULT/network_label_regex').with_value('^private$')
should contain_trove_taskmanager_config('DEFAULT/network_label_regex').with_value('^private$')
end
end
end
end