Allow disabling nova::cache

This is useful for test/debugging purposes only.
It is quite useful to skip the memcache layer in certain situations,
so let's allow to override it via a hiera key, while we clearly
state it as a not support configuration.

Change-Id: I9963b2ac5aa46568e31df0fce58c90c797876d79
This commit is contained in:
Michele Baldessari 2019-01-23 10:23:03 +01:00
parent a71e9f8074
commit a63ce4aef8
1 changed files with 7 additions and 1 deletions

View File

@ -77,6 +77,11 @@
# [*memcached_ips*]
# (Optional) Array of ipv4 or ipv6 addresses for memcache.
# Defaults to hiera('memcached_node_ips')
#
# [*enable_cache*]
# (Optional) Enable the use of cache. Note that it is unsupported
# to disable this key. It is only useful for debugging purposes.
# Defaults to true
class tripleo::profile::base::nova (
$bootstrap_node = hiera('nova_api_short_bootstrap_node_name', undef),
@ -94,6 +99,7 @@ class tripleo::profile::base::nova (
$oslomsg_notify_use_ssl = hiera('oslo_messaging_notify_use_ssl', '0'),
$step = Integer(hiera('step')),
$memcached_ips = hiera('memcached_node_ips'),
$enable_cache = true,
) {
if $::hostname == downcase($bootstrap_node) {
@ -114,7 +120,7 @@ class tripleo::profile::base::nova (
include ::nova::config
include ::nova::logging
class { '::nova::cache':
enabled => true,
enabled => $enable_cache,
backend => 'oslo_cache.memcache_pool',
memcache_servers => $memcache_servers,
}