diff --git a/ansible/roles/horizon/templates/local_settings.j2 b/ansible/roles/horizon/templates/local_settings.j2
index 18159f3f76ad5db3119ae270b7d81d2fd17d2308..4e41d4bad21cbe1a76dfed466650ec1a946bb469 100644
--- a/ansible/roles/horizon/templates/local_settings.j2
+++ b/ansible/roles/horizon/templates/local_settings.j2
@@ -136,7 +136,7 @@ CACHES = {
 {% if orchestration_engine == 'KUBERNETES' %}
         'LOCATION': '{{ memcached_servers }}'
 {% else %}
-        'LOCATION': '{% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}'
+        'LOCATION': [{% for host in groups['memcached'] %}'{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }}'{% if not loop.last %},{% endif %}{% endfor %}]
 {%- endif %}
     }
 }