diff --git a/defaults/main.yml b/defaults/main.yml index b3224cba..611f8d7a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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: diff --git a/tasks/horizon_post_install.yml b/tasks/horizon_post_install.yml index 08822a97..42be3853 100644 --- a/tasks/horizon_post_install.yml +++ b/tasks/horizon_post_install.yml @@ -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 diff --git a/templates/horizon_local_settings.py.j2 b/templates/horizon_local_settings.py.j2 index a5d69c65..75ee0898 100644 --- a/templates/horizon_local_settings.py.j2 +++ b/templates/horizon_local_settings.py.j2 @@ -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 %}