Add options to configure cache in nova
This patch adds new options:
* CACHE_BACKEND - with default "dogpile.cache.memcached"
* MEMCACHE_SERVERS - with default "localhost:1121"
to add possibility to configure various backends as cache in
Nova and Keystone.
It also adds options:
* KEYSTONE_ENABLE_CACHE - True by default
* NOVA_ENABLE_CACHE - True by default
To make possibility to enable and disable cache in those projects'
config files.
Default values configured there are the same as before were
hardcoded for Keystone config.
Nova has also enabled this cache by default.
Change-Id: I9082be077b59acd3a39910fa64e29147cb5c2dd7
Closes-Bug: #1836642
diff --git a/lib/keystone b/lib/keystone
index 5bd552f..9ceb829 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -131,6 +131,9 @@
# however may not be suitable for real production.
KEYSTONE_PASSWORD_HASH_ROUNDS=${KEYSTONE_PASSWORD_HASH_ROUNDS:-4}
+# Cache settings
+KEYSTONE_ENABLE_CACHE=${KEYSTONE_ENABLE_CACHE:-True}
+
# Functions
# ---------
@@ -213,9 +216,9 @@
iniset $KEYSTONE_CONF resource driver "$KEYSTONE_RESOURCE_BACKEND"
# Enable caching
- iniset $KEYSTONE_CONF cache enabled "True"
- iniset $KEYSTONE_CONF cache backend "dogpile.cache.memcached"
- iniset $KEYSTONE_CONF cache memcache_servers localhost:11211
+ iniset $KEYSTONE_CONF cache enabled $KEYSTONE_ENABLE_CACHE
+ iniset $KEYSTONE_CONF cache backend $CACHE_BACKEND
+ iniset $KEYSTONE_CONF cache memcache_servers $MEMCACHE_SERVERS
iniset_rpc_backend keystone $KEYSTONE_CONF oslo_messaging_notifications