From 9bfa77c341162245db845605e55130fd76d6572f Mon Sep 17 00:00:00 2001 From: Stefan Dinescu Date: Mon, 2 Dec 2019 14:20:00 +0200 Subject: [PATCH] Enable keystone caching Since memcached is installed on the system, we should also enable keystone caching with memcached. Change-Id: Ibd5135bfc753336f8e70e1e419aba0488837935e Closes-bug: 1854196 Signed-off-by: Stefan Dinescu (cherry picked from commit 2b96f733eae2951965e72dd3f7e1316f50d5b686) --- sysinv/sysinv/sysinv/sysinv/puppet/keystone.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sysinv/sysinv/sysinv/sysinv/puppet/keystone.py b/sysinv/sysinv/sysinv/sysinv/puppet/keystone.py index fca6cd683c..6f9f9cc6b6 100644 --- a/sysinv/sysinv/sysinv/sysinv/puppet/keystone.py +++ b/sysinv/sysinv/sysinv/sysinv/puppet/keystone.py @@ -46,6 +46,8 @@ class KeystonePuppet(openstack.OpenstackBasePuppet): return { 'keystone::db::postgresql::user': dbuser, + 'keystone::cache_enabled': True, + 'keystone::cache_backend': 'dogpile.cache.memcached', 'platform::client::params::admin_username': admin_username, @@ -150,6 +152,22 @@ class KeystonePuppet(openstack.OpenstackBasePuppet): } return config + def get_host_config(self, host): + # The valid format for IPv6 addresses is: inet6:[]:port + # Although, for IPv4, the "inet" part is not mandatory, we + # specify if anyway, for consistency purposes. + if self._get_address_by_name( + constants.CONTROLLER_PLATFORM_NFS, + constants.NETWORK_TYPE_MGMT).family == constants.IPV6_FAMILY: + argument = "url:inet6:[%s]:11211" % host.mgmt_ip + else: + argument = "url:inet:%s:11211" % host.mgmt_ip + + config = { + 'keystone::cache_backend_argument': argument + } + return config + def _get_service_parameter_config(self): service_parameters = self._get_service_parameter_configs( constants.SERVICE_TYPE_IDENTITY)