Add support for Horizon customization module

Allow the deployer to specify a customization module to be uploaded and configured
in Horizon. The process is outlined here in the Horizon documentation:
http://docs.openstack.org/developer/horizon/topics/customizing.html#horizon-customization-module-overrides

Change-Id: Ie638c826abe43f1f484f16e60b90fbe25c684c6e
This commit is contained in:
Logan V 2016-03-09 20:57:05 -06:00 committed by Jesse Pretorius (odyssey4me)
parent 0b35d1c180
commit 1f52acc1c3
3 changed files with 32 additions and 0 deletions

View File

@ -142,6 +142,10 @@ horizon_swift_file_transfer_chunk_size: 524288
## Panel
horizon_default_panel: overview
## Customization module
## See http://docs.openstack.org/developer/horizon/topics/customizing.html#horizon-customization-module-overrides
# horizon_customization_module: /local/path/to/customization_module.py
horizon_webroot: /
horizon_listen_ports:

View File

@ -92,3 +92,26 @@
tags:
- horizon-configs
- horizon-wsgi-venv
- name: Create customization module directory
file:
path: "{{ horizon_lib_dir }}/horizon_customization"
state: directory
owner: "{{ horizon_system_user_name }}"
group: "{{ horizon_system_group_name }}"
mode: "0755"
when: horizon_customization_module is defined
tags:
- horizon-configs
- name: Drop horizon customization module
template:
src: "{{ horizon_customization_module }}"
dest: "{{ horizon_lib_dir }}/horizon_customization/__init__.py"
owner: "{{ horizon_system_user_name }}"
group: "{{ horizon_system_group_name }}"
mode: "0644"
notify: Restart apache2
when: horizon_customization_module is defined
tags:
- horizon-configs

View File

@ -715,3 +715,8 @@ REST_API_REQUIRED_SETTINGS = ['OPENSTACK_HYPERVISOR_FEATURES']
{% if horizon_site_name is defined %}
SITE_BRANDING = '{{ horizon_site_name }}'
{% endif %}
{% if horizon_customization_module is defined %}
#custom python module with horizon dashboard theme overrides
HORIZON_CONFIG["customization_module"] = 'horizon_customization.overrides'
{% endif %}