summaryrefslogtreecommitdiff
path: root/strata/openstack-services
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2015-05-28 09:54:26 +0000
committerFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2015-06-11 17:04:29 +0000
commite10ad8da85f1dc117d8df7a4c088b98d6335806d (patch)
tree3cbedf1d6f451bb975a77cf112cf3406615c6188 /strata/openstack-services
parentbfe523b5328d9fdccefb29b685d396e3de7427e2 (diff)
downloaddefinitions-e10ad8da85f1dc117d8df7a4c088b98d6335806d.tar.gz
OpenStack: Add custom configuration for the components
Add custom configuration for Keystone, Nova, Neutron, Cinder, Glance, Ironic, Swift, Ceilometer, Horizon and Tempest for Openstack Kilo release. Notes: - Horizon configuration has change in order to be less error prone and to be close to the default configuration, the following changes has been made to achive this purpose: - Install the openstack_dashboard django project in /var/lib/horizon avoiding: - to write in /usr/lib/python2.7/site-packages/static - to maintain a copy of local_settings.py - to create a symlink as workaround to make django.wsgi to work with the previous configuration. - Change the path of django.wsgi file - Remove the 'horizon/' suffix to access Horizon via URL. - Grant permissions to access to /var/lib/horizon/static Signed-off-by: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk> Signed-off-by: Patrick Darley <patrick.darley@codethink.co.uk> Signed-off-by: Tiago Gomes <tiago.gomes@codethink.co.uk> Change-Id: I1fda4f85eb334b1b5bfec54dfcd9780a6112ea3b
Diffstat (limited to 'strata/openstack-services')
-rw-r--r--strata/openstack-services/horizon.morph66
1 files changed, 35 insertions, 31 deletions
diff --git a/strata/openstack-services/horizon.morph b/strata/openstack-services/horizon.morph
index ae6399b1..74930a1e 100644
--- a/strata/openstack-services/horizon.morph
+++ b/strata/openstack-services/horizon.morph
@@ -4,16 +4,12 @@ configure-commands:
# Remove unnecessary .mo files they will be generated
# later during package build.
- find . -name "django*.mo" -exec rm -f '{}' \;
-# Set COMPRESS_OFFLINE=True
-- |
- sed -i 's:COMPRESS_OFFLINE.=.False:COMPRESS_OFFLINE = True:' \
- openstack_dashboard/settings.py
build-commands:
# Compile message strings
-- cd horizon && django-admin.py compilemessages && cd ..
-- cd openstack_dashboard && django-admin.py compilemessages && cd ..
+- cd horizon && django-admin.py compilemessages
+- cd openstack_dashboard && django-admin.py compilemessages
- python setup.py build
-post-build-commands:
+
# Use the local_settings.py example to compile and compress the css, js, etc files.
# This is a hack to make SECRET_KEY work.
- |
@@ -23,37 +19,45 @@ post-build-commands:
- python manage.py collectstatic --noinput
- python manage.py compress --force
install-commands:
-# Undo hack
+# Install horizon in a temporary folder first, and then move things to the
+# right place in $DESTDIR
+- mkdir temproot
+- python setup.py install -O1 --skip-build --prefix "$PREFIX" --root temproot
+# Remove unnecessary .po files
+- find temproot -name django.po -exec rm '{}' \;
+- find temproot -name djangojs.po -exec rm '{}' \;
+
+# Move openstack_dashboard to /var/lib/horizon
+- mkdir -p "$DESTDIR"/var/lib/horizon/
+- |
+ mv temproot/"$PREFIX"/lib/python*/site-packages/openstack_dashboard \
+ "$DESTDIR"/var/lib/horizon/
+- cp manage.py "$DESTDIR"/var/lib/horizon/openstack_dashboard/
+
+# Copy the rest to $DESTDIR
+- cp -a temproot/* "$DESTDIR"
+
+# Copy local_settings to /etc/horizon/openstack_dashboard, so that they
+# can be modified, and link them where openstack_dashboard is installed.
+- mkdir -p "$DESTDIR"/etc/horizon/openstack_dashboard/
- |
cp openstack_dashboard/local/local_settings.py.example \
- openstack_dashboard/local/local_settings.py
-# Install horizon
-- python setup.py install -O1 --skip-build --prefix "$PREFIX" --root "$DESTDIR"
-post-install-commands:
-# Remove unnecessary .po files
-- find "$DESTDIR" -name django.po -exec rm '{}' \;
-- find "$DESTDIR" -name djangojs.po -exec rm '{}' \;
-# Link Openstack local_settings where openstack_dashboard is installed.
+ "$DESTDIR"/etc/horizon/openstack_dashboard/local_settings.py
+# Set COMPRESS_OFFLINE=True
+- |
+ echo "COMPRESS_OFFLINE=True" >> \
+ "$DESTDIR"/etc/horizon/openstack_dashboard/local_settings.py
+
- mkdir -p "$DESTDIR"/var/lib/horizon/openstack_dashboard/local
- |
ln -sf /etc/horizon/openstack_dashboard/local_settings.py \
- "$DESTDIR$PREFIX"/lib/python2.7/site-packages/openstack_dashboard/local/local_settings.py
+ "$DESTDIR"/var/lib/horizon/openstack_dashboard/local/local_settings.py
+
# Create the static directory (STATIC_ROOT) used in local_settings.py to keep
# the static objects like css files.
-- mkdir -p "$DESTDIR"/var/lib/horizon/openstack_dashboard/static
+- mkdir -p "$DESTDIR"/var/lib/horizon/static
# Copy the compressed static files to horizon.
-- cp -a openstack_dashboard/static/* "$DESTDIR"/var/lib/horizon/openstack_dashboard/static
-- cp -a horizon/static/* "$DESTDIR"/var/lib/horizon/openstack_dashboard/static
-- cp -a static/* "$DESTDIR"/var/lib/horizon/openstack_dashboard/static
-# Work around to make django.wsgi working with horizon
-# See: https://bugs.launchpad.net/osprofiler/+bug/1361235
-# and: https://git.openstack.org/cgit/openstack/tripleo-image-elements/commit/?id=41c9a1dfad23f8aee366afb6a0b20a6c57ec8f79
-- |
- sed -i "s|'../..'|os.path.realpath('../..')|" \
- "$DESTDIR$PREFIX"/lib/python2.7/site-packages/openstack_dashboard/wsgi/django.wsgi
-# And link this django.wsgi file to the horizon home directory
-- |
- ln -sf "$PREFIX"/lib/python2.7/site-packages/openstack_dashboard/wsgi/django.wsgi \
- "$DESTDIR"/var/lib/horizon/openstack_dashboard/django.wsgi
+- cp -a static/* "$DESTDIR"/var/lib/horizon/static
+
# Create the horizon document root for apache configuration
- mkdir -p "$DESTDIR"/var/lib/horizon/.blackhole