Adds support for Nova Memcached
Previously, the openstack::nova::controller class could only use Nova's in-process cache for storing information such as nova-consoleauth session tokens. This patch adds a new parameter called memcached_servers that allows Nova to use memcached instead of the in-process cache. Defaults to false to continue having Nova use the in-process cache for backwards compatibility. Change-Id: Ic61962e6ebf588e5724d238954ec611b0bbcbd05
This commit is contained in:
@@ -6,6 +6,11 @@
|
|||||||
#
|
#
|
||||||
# === Parameters
|
# === Parameters
|
||||||
#
|
#
|
||||||
|
# [memcached_servers]
|
||||||
|
# Use memcached instead of in-process cache.
|
||||||
|
# Supply a list of memcached server IP's:Memcached Port.
|
||||||
|
# (optional) Defaults to false.
|
||||||
|
#
|
||||||
# [quantum]
|
# [quantum]
|
||||||
# Specifies if nova should be configured to use quantum.
|
# Specifies if nova should be configured to use quantum.
|
||||||
# (optional) Defaults to false (indicating nova-networks should be used)
|
# (optional) Defaults to false (indicating nova-networks should be used)
|
||||||
@@ -61,6 +66,7 @@ class openstack::nova::controller (
|
|||||||
$nova_db_user = 'nova',
|
$nova_db_user = 'nova',
|
||||||
$nova_db_dbname = 'nova',
|
$nova_db_dbname = 'nova',
|
||||||
$enabled_apis = 'ec2,osapi_compute,metadata',
|
$enabled_apis = 'ec2,osapi_compute,metadata',
|
||||||
|
$memcached_servers = false,
|
||||||
# Rabbit
|
# Rabbit
|
||||||
$rabbit_user = 'openstack',
|
$rabbit_user = 'openstack',
|
||||||
$rabbit_virtual_host = '/',
|
$rabbit_virtual_host = '/',
|
||||||
@@ -119,6 +125,7 @@ class openstack::nova::controller (
|
|||||||
rabbit_virtual_host => $rabbit_virtual_host,
|
rabbit_virtual_host => $rabbit_virtual_host,
|
||||||
image_service => 'nova.image.glance.GlanceImageService',
|
image_service => 'nova.image.glance.GlanceImageService',
|
||||||
glance_api_servers => $glance_connection,
|
glance_api_servers => $glance_connection,
|
||||||
|
memcached_servers => $memcached_servers,
|
||||||
debug => $debug,
|
debug => $debug,
|
||||||
verbose => $verbose,
|
verbose => $verbose,
|
||||||
rabbit_host => $rabbit_connection,
|
rabbit_host => $rabbit_connection,
|
||||||
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|||||||
|
|
||||||
describe 'openstack::nova::controller' do
|
describe 'openstack::nova::controller' do
|
||||||
|
|
||||||
let :params do
|
let :default_params do
|
||||||
{
|
{
|
||||||
:public_address => '127.0.0.1',
|
:public_address => '127.0.0.1',
|
||||||
:db_host => '127.0.0.1',
|
:db_host => '127.0.0.1',
|
||||||
@@ -11,6 +11,7 @@ describe 'openstack::nova::controller' do
|
|||||||
:quantum_user_password => 'quantum_user_pass',
|
:quantum_user_password => 'quantum_user_pass',
|
||||||
:nova_db_password => 'nova_db_pass',
|
:nova_db_password => 'nova_db_pass',
|
||||||
:quantum => true,
|
:quantum => true,
|
||||||
|
:memcached_servers => false,
|
||||||
:metadata_shared_secret => 'secret'
|
:metadata_shared_secret => 'secret'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@@ -19,6 +20,10 @@ describe 'openstack::nova::controller' do
|
|||||||
{:osfamily => 'Debian' }
|
{:osfamily => 'Debian' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
let :params do
|
||||||
|
default_params
|
||||||
|
end
|
||||||
|
|
||||||
it { should contain_class('openstack::nova::controller') }
|
it { should contain_class('openstack::nova::controller') }
|
||||||
|
|
||||||
context 'when configuring quantum' do
|
context 'when configuring quantum' do
|
||||||
@@ -70,9 +75,19 @@ describe 'openstack::nova::controller' do
|
|||||||
:host => '127.0.0.1',
|
:host => '127.0.0.1',
|
||||||
:enabled => true
|
:enabled => true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when configuring memcached' do
|
||||||
|
let :params do
|
||||||
|
default_params.merge(
|
||||||
|
:memcached_servers => ['memcached01:11211', 'memcached02:11211']
|
||||||
|
)
|
||||||
|
end
|
||||||
|
it 'should configure nova with memcached' do
|
||||||
|
should contain_class('nova').with(
|
||||||
|
:memcached_servers => ['memcached01:11211', 'memcached02:11211']
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user