Use memcache for consoleauth and horizon

Unfortunately there was no was to avoid memcache for consoleauth, so
we might as well take advantage of it for Horizon as well.

Change-Id: Idd338a025b031f6b50fe0c9f03c2c8d862f9d4c0
Closes-Bug: #1504606
Closes-Bug: #1504800
This commit is contained in:
Sam Yaple 2015-10-15 08:54:36 +00:00
parent 63a2f61bc8
commit 2ea87ebdb7
7 changed files with 14 additions and 11 deletions

View File

@ -134,6 +134,7 @@ openstack_auth_v2:
enable_glance: "yes"
enable_haproxy: "yes"
enable_keystone: "yes"
enable_memcached: "yes"
enable_mariadb: "yes"
enable_neutron: "yes"
enable_nova: "yes"

View File

@ -117,21 +117,15 @@ LOCAL_PATH = '/tmp'
# (usually behind a load-balancer). Either you have to make sure that a session
# gets all requests routed to the same dashboard instance or you set the same
# SECRET_KEY for all of them.
SECRET_KEY='605f2a71e76a686b70eb'
SECRET_KEY='{{ horizon_secret_key }}'
# We recommend you use memcached for development; otherwise after every reload
# of the django development server, you will have to login again. To use
# memcached set CACHES to something like
#CACHES = {
# 'default': {
# 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
# 'LOCATION': '127.0.0.1:11211',
# }
#}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '{% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}',
}
}

View File

@ -32,6 +32,9 @@ linuxnet_interface_driver = nova.network.linux_net.BridgeInterfaceDriver
allow_resize_to_same_host = true
memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}
# Though my_ip is not used directly, lots of other variables use $my_ip
my_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}

View File

@ -1,4 +1,3 @@
---
dependencies:
- { role: common }
- { role: memcached }

View File

@ -7,6 +7,10 @@
roles:
- { role: haproxy, tags: haproxy, when: enable_haproxy | bool }
- hosts: memcached
roles:
- { role: memcached, tags: memcache, memcached, when: enable_memcached | bool }
- hosts: mariadb
roles:
- { role: mariadb, tags: mariadb, when: enable_mariadb | bool }

View File

@ -93,6 +93,7 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
python-tuskarclient \
python-zaqarclient \
python-openstackclient \
MySQL-python
MySQL-python \
python-memcached
{% endif %}

View File

@ -56,6 +56,7 @@ murano_keystone_password: "password"
ironic_database_password: "password"
ironic_keystone_password: "password"
horizon_secret_key: "password"
####################
# RabbitMQ options