aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Yaple <sam@yaple.net>2015-10-15 08:54:36 +0000
committerSam Yaple <sam@yaple.net>2015-10-15 10:47:21 +0000
commit2ea87ebdb7b15011c2825d23dc160ef0aa76fa0e (patch)
tree857d2cd21e5797d2bc2ce094b191e22cd20b0353
parent63a2f61bc853d502e803aab92dce2af12286aa71 (diff)
downloadkolla-2ea87ebdb7b15011c2825d23dc160ef0aa76fa0e.tar.gz
kolla-2ea87ebdb7b15011c2825d23dc160ef0aa76fa0e.zip
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
-rw-r--r--ansible/group_vars/all.yml1
-rw-r--r--ansible/roles/horizon/templates/local_settings.j212
-rw-r--r--ansible/roles/nova/templates/nova.conf.j23
-rw-r--r--ansible/roles/swift/meta/main.yml1
-rwxr-xr-xansible/site.yml4
-rw-r--r--docker/openstack-base/Dockerfile.j23
-rw-r--r--etc/kolla/passwords.yml1
7 files changed, 14 insertions, 11 deletions
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index 76dba6f08..845c7e443 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -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"
diff --git a/ansible/roles/horizon/templates/local_settings.j2 b/ansible/roles/horizon/templates/local_settings.j2
index baf53dcdc..f0ab43030 100644
--- a/ansible/roles/horizon/templates/local_settings.j2
+++ b/ansible/roles/horizon/templates/local_settings.j2
@@ -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 %}',
}
}
diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2
index 98300fc03..b8855d3bc 100644
--- a/ansible/roles/nova/templates/nova.conf.j2
+++ b/ansible/roles/nova/templates/nova.conf.j2
@@ -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'] }}
diff --git a/ansible/roles/swift/meta/main.yml b/ansible/roles/swift/meta/main.yml
index f478e6912..6b4fff8fe 100644
--- a/ansible/roles/swift/meta/main.yml
+++ b/ansible/roles/swift/meta/main.yml
@@ -1,4 +1,3 @@
---
dependencies:
- { role: common }
- - { role: memcached }
diff --git a/ansible/site.yml b/ansible/site.yml
index 00e8f64f9..f89884f23 100755
--- a/ansible/site.yml
+++ b/ansible/site.yml
@@ -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 }
diff --git a/docker/openstack-base/Dockerfile.j2 b/docker/openstack-base/Dockerfile.j2
index 345a1b604..a29f0ad84 100644
--- a/docker/openstack-base/Dockerfile.j2
+++ b/docker/openstack-base/Dockerfile.j2
@@ -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 %}
diff --git a/etc/kolla/passwords.yml b/etc/kolla/passwords.yml
index 04a30e797..03afac043 100644
--- a/etc/kolla/passwords.yml
+++ b/etc/kolla/passwords.yml
@@ -56,6 +56,7 @@ murano_keystone_password: "password"
ironic_database_password: "password"
ironic_keystone_password: "password"
+horizon_secret_key: "password"
####################
# RabbitMQ options