openstack-ansible-os_horizon/tasks/horizon_post_install.yml
Kevin Carter 55f30c4c68 Add template option for the default horizon panel
The change adds the option to set the default panel within horizon.
this change is useful when a tenant has many hundreds of vms and
running into horizon login slowness due to poorly crafted api
calls and sql statements.

Change-Id: If3da12a466d4953a176ec8e45499bf1cd9452ae5
Closes-Bug: #1533830
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-01-13 20:48:13 -06:00

96 lines
3.1 KiB
YAML

---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Because there is no specific "horizon" command this method
# is looking for the "keystone" command to set the horizon
# command path.
- name: Get horizon command path
command: which keystone
register: horizon_command_path
when:
- not horizon_venv_enabled | bool
tags:
- horizon-command-bin
- name: Set horizon command path
set_fact:
horizon_bin: "{{ horizon_command_path.stdout | dirname }}"
when:
- not horizon_venv_enabled | bool
tags:
- horizon-command-bin
- name: Setup Horizon config(s)
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ horizon_system_user_name }}"
group: "{{ horizon_system_group_name }}"
mode: "{{ item.mode }}"
with_items:
- { src: "horizon_local_settings.py.j2", dest: "/etc/horizon/local_settings.py", mode: "0644" }
- { src: "horizon-manage.py.j2", dest: "{{ horizon_bin }}/horizon-manage.py", mode: "0755" }
- { src: "80_admin_default_panel.py.j2", dest: "{{ horizon_lib_dir }}/openstack_dashboard/local/enabled/_80_admin_default_panel.py", mode: "0755" }
notify: Restart apache2
tags:
- horizon-configs
- horizon-branding
- name: Uploading horizon custom files
copy:
src: "{{ item.value.src }}"
dest: "{{ horizon_lib_dir }}/openstack_dashboard/static/dashboard/{{ item.value.dest }}"
with_dict: "{{ horizon_custom_uploads | default({}) }}"
when: horizon_custom_uploads is defined
tags:
- horizon-branding
- name: Create horizon links
file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ horizon_system_user_name }}"
group: "{{ horizon_system_group_name }}"
state: "link"
with_items:
- { src: "/etc/horizon/local_settings.py", dest: "{{ horizon_lib_dir }}/openstack_dashboard/local/local_settings.py" }
tags:
- horizon-configs
- name: Collect and compress static files
command: "{{ item }}"
sudo: yes
sudo_user: "{{ horizon_system_user_name }}"
with_items:
- "{{ horizon_bin }}/horizon-manage.py collectstatic --noinput"
- "{{ horizon_bin }}/horizon-manage.py compress --force"
tags:
- horizon-configs
- horizon-static-collect
- horizon-command-bin
- name: Setup Horizon config(s)
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ horizon_system_user_name }}"
group: "{{ horizon_system_group_name }}"
with_items:
- { src: "horizon_django.wsgi.j2", dest: "{{ horizon_lib_wsgi_file }}" }
notify: Restart apache2
tags:
- horizon-configs
- horizon-wsgi-venv