Enable oslo.cache library

Add glance:server:cache metadata

      cache:
        engine: memcached
        expiration_time: 600
        backend_argument:
          memcached_expire_time:
            value: 660
        members:
        - host: ${_param:cluster_node01_address}
          port: 11211
        - host: ${_param:cluster_node02_address}
          port: 11211
        - host: ${_param:cluster_node01_address}
          port: 11211

Enable oslo.cache in the glance config files:
 - glance-api.conf
 - glance-registry.conf

Change-Id: I0d183ea7e551b59cea5ff125d550cd5f5914239e
Related-Prod: PROD-26960
diff --git a/glance/files/queens/glance-api.conf.Debian b/glance/files/queens/glance-api.conf.Debian
index f7400dd..8a6634d 100644
--- a/glance/files/queens/glance-api.conf.Debian
+++ b/glance/files/queens/glance-api.conf.Debian
@@ -3622,3 +3622,10 @@
 [barbican]
 {%- include "oslo_templates/files/queens/castellan/_barbican.conf" %}
 {%- endif %}
+
+{%- if server.cache is defined %}
+{%- set _data = {} %}
+{%- do _data.update(server.cache) %}
+[cache]
+{%- include "oslo_templates/files/queens/oslo/_cache.conf" %}
+{%- endif %}
diff --git a/glance/files/queens/glance-registry.conf.Debian b/glance/files/queens/glance-registry.conf.Debian
index c362627..7450a6d 100644
--- a/glance/files/queens/glance-registry.conf.Debian
+++ b/glance/files/queens/glance-registry.conf.Debian
@@ -1098,3 +1098,10 @@
 {%- endif %}
 {%- include "oslo_templates/files/queens/keystonemiddleware/_auth_token.conf" %}
 {%- include "oslo_templates/files/queens/keystoneauth/_type_" + auth_type + ".conf" %}
+
+{%- if server.cache is defined %}
+{%- set _data = {} %}
+{%- do _data.update(server.cache) %}
+[cache]
+{%- include "oslo_templates/files/queens/oslo/_cache.conf" %}
+{%- endif %}
diff --git a/glance/files/rocky/glance-api.conf.Debian b/glance/files/rocky/glance-api.conf.Debian
index 73b1445..2a07551 100644
--- a/glance/files/rocky/glance-api.conf.Debian
+++ b/glance/files/rocky/glance-api.conf.Debian
@@ -3405,3 +3405,10 @@
 {%- set _data = server.identity %}
 {%- include "oslo_templates/files/" ~ server.version ~ "/castellan/_barbican.conf" %}
 {%- endif %}
+
+{%- if server.cache is defined %}
+{%- set _data = {} %}
+{%- do _data.update(server.cache) %}
+[cache]
+{%- include "oslo_templates/files/" ~ server.version ~ "/oslo/_cache.conf" %}
+{%- endif %}
diff --git a/glance/files/rocky/glance-registry.conf.Debian b/glance/files/rocky/glance-registry.conf.Debian
index d35d0a9..29122f9 100644
--- a/glance/files/rocky/glance-registry.conf.Debian
+++ b/glance/files/rocky/glance-registry.conf.Debian
@@ -1684,3 +1684,10 @@
 # * False: Disable the filter.
 #  (boolean value)
 #filter_error_trace = false
+
+{%- if server.cache is defined %}
+{%- set _data = {} %}
+{%- do _data.update(server.cache) %}
+[cache]
+{%- include "oslo_templates/files/" ~ server.version ~ "/oslo/_cache.conf" %}
+{%- endif %}
diff --git a/metadata/service/control/cluster.yml b/metadata/service/control/cluster.yml
index d50efba..561dc31 100644
--- a/metadata/service/control/cluster.yml
+++ b/metadata/service/control/cluster.yml
@@ -56,6 +56,10 @@
         virtual_host: '/openstack'
       cache:
         engine: memcached
+        expiration_time: 600
+        backend_argument:
+          memcached_expire_time:
+            value: 660
         members:
         - host: ${_param:cluster_node01_address}
           port: 11211
diff --git a/metadata/service/control/single.yml b/metadata/service/control/single.yml
index 0e16de5..0987a6f 100644
--- a/metadata/service/control/single.yml
+++ b/metadata/service/control/single.yml
@@ -52,3 +52,12 @@
         user: openstack
         password: ${_param:rabbitmq_openstack_password}
         virtual_host: '/openstack'
+      cache:
+        engine: memcached
+        expiration_time: 600
+        backend_argument:
+          memcached_expire_time:
+            value: 660
+        members:
+        - host: ${_param:single_address}
+          port: 11211
diff --git a/tests/pillar/cluster.sls b/tests/pillar/cluster.sls
index 35d5f62..45adbdb 100644
--- a/tests/pillar/cluster.sls
+++ b/tests/pillar/cluster.sls
@@ -60,6 +60,10 @@
       user_storage: 0
     cache:
       engine: memcached
+      expiration_time: 600
+      backend_argument:
+        memcached_expire_time:
+          value: 660
       members:
       - host: 127.0.0.1
         port: 11211