Allow python-memcache install from authtoken class

The python-memcache package is required if using memcached. By
default the package is not installed and the define has it set to
false. This change allows managing the python-memcache package
install from the authtoken class.

Change-Id: Ifd3fdea4c08fa9df451bcd4dc01f70b9a53f72c8
This commit is contained in:
Matthew J. Black 2017-01-11 18:50:17 -05:00
parent 1e7baef271
commit 77d260badc
2 changed files with 11 additions and 0 deletions

View File

@ -166,6 +166,10 @@
# caching. If left undefined, tokens will instead be cached in-process.
# Defaults to $::os_service_default.
#
# [*manage_memcache_package*]
# (Optional) Whether to install the python-memcache package.
# Defaults to false.
#
# [*region_name*]
# (Optional) The region in which the identity server can be found.
# Defaults to $::os_service_default.
@ -215,6 +219,7 @@ class watcher::keystone::authtoken (
$memcache_use_advanced_pool = $::os_service_default,
$memcache_pool_unused_timeout = $::os_service_default,
$memcached_servers = $::os_service_default,
$manage_memcache_package = false,
$region_name = $::os_service_default,
$revocation_cache_time = $::os_service_default,
$token_cache_time = $::os_service_default,
@ -260,6 +265,7 @@ class watcher::keystone::authtoken (
memcache_use_advanced_pool => $memcache_use_advanced_pool,
memcache_pool_unused_timeout => $memcache_pool_unused_timeout,
memcached_servers => $memcached_servers,
manage_memcache_package => $manage_memcache_package,
region_name => $region_name,
revocation_cache_time => $revocation_cache_time,
token_cache_time => $token_cache_time,

View File

@ -86,6 +86,7 @@ describe 'watcher::keystone::authtoken' do
:memcache_security_strategy => 'ENCRYPT',
:memcache_use_advanced_pool => true,
:memcached_servers => ['memcached01:11211','memcached02:11211'],
:manage_memcache_package => true,
:region_name => 'region2',
:revocation_cache_time => '11',
:token_cache_time => '301',
@ -128,6 +129,10 @@ describe 'watcher::keystone::authtoken' do
is_expected.to contain_watcher_config('keystone_authtoken/revocation_cache_time').with_value(params[:revocation_cache_time])
is_expected.to contain_watcher_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time])
end
it 'installs python memcache package' do
is_expected.to contain_package('python-memcache')
end
end
end