Add memcache backend

Install and configure memcached on the keystone units and configure
keystone to use the cache. This should speed up token access for
existing tokens.

Change-Id: I26af0a97660e5bbe293a32e6b9e3d209338f905a
Closes-Bug: #1722541
This commit is contained in:
Liam Young
2017-10-12 10:47:03 +00:00
parent effe368622
commit 4b00281bb4
11 changed files with 150 additions and 63 deletions

View File

@@ -74,6 +74,7 @@ from charmhelpers.contrib.openstack.utils import (
snap_install_requested,
install_os_snaps,
get_snaps_install_info_from_origin,
enable_memcache,
)
from keystone_utils import (
@@ -250,7 +251,8 @@ def config_changed_postupgrade():
ensure_ssl_dirs()
save_script_rc()
if run_in_apache():
release = os_release('keystone')
if run_in_apache(release=release):
# Need to ensure mod_wsgi is installed and apache2 is reloaded
# immediatly as charm querys its local keystone before restart
# decorator can fire
@@ -265,6 +267,11 @@ def config_changed_postupgrade():
if not is_unit_paused_set():
restart_pid_check('apache2')
if enable_memcache(release=release):
# If charm or OpenStack have been upgraded then the list of required
# packages may have changed so ensure they are installed.
apt_install(filter_installed_packages(determine_packages()))
configure_https()
open_port(config('service-port'))