Merge "Implements custom theme distribution"

This commit is contained in:
Zuul 2018-08-16 17:13:00 +00:00 committed by Gerrit Code Review
commit d2b1e350f9
3 changed files with 36 additions and 3 deletions

View File

@ -275,9 +275,12 @@ _horizon_available_themes:
theme_label: "Material"
theme_path: "themes/material"
# Add custom themes. Deployers need to place the theme directories
# and files on the horizon containers in:
# {{ horizon_lib_dir }}/openstack_dashboard/themes
# Add custom themes. Deployers need to place the archive, with the theme inside,
# into the directory, which is specified by theme_src_archive key.
# It should be an absolute path to the archive on the deployment host.
# Leading folders are not expected in the archive.
# Following archive formats are supported:
# .tar.gz, .tgz, .zip, .tar.bz, .tar.bz2, .tbz, .tbz2
# See https://docs.openstack.org/horizon/latest/configuration/themes.html
# for more details on custom themes
# Example:
@ -287,6 +290,7 @@ _horizon_available_themes:
# theme_name: "custom"
# theme_label: "Custom"
# theme_path: "themes/custom"
# theme_src_archive: "/etc/openstack_deploy/horizon/themes/custom.tar.gz"
#
horizon_custom_themes: {}

View File

@ -0,0 +1,10 @@
---
features:
- The ``os_horizon`` role now supports distribution of user custom themes.
Deployers can use the new key ``theme_src_archive`` of ``horizon_custom_themes``
dictionary to provide absolute path to the archived theme.
Only .tar.gz, .tgz, .zip, .tar.bz, .tar.bz2, .tbz, .tbz2 archives are supported.
Structure inside archive should be as a standard theme, without any leading folders.
fixes:
- Fixes bug https://bugs.launchpad.net/openstack-ansible/+bug/1778098 where playbook failed, if
``horizon_custom_themes`` is specified, and directory for theme is not provided

View File

@ -96,6 +96,25 @@
notify: Restart apache2
when: horizon_customization_module is defined
- name: Creating horizon custom theme path
file:
path: "{{ horizon_lib_dir }}/openstack_dashboard/{{ item.value.theme_path }}/"
state: directory
owner: "{{ horizon_system_user_name }}"
group: "{{ horizon_system_group_name }}"
mode: "0755"
with_dict: "{{ horizon_custom_themes }}"
- name: Drop horizon custom themes
unarchive:
src: "{{ item.value.theme_src_archive }}"
dest: "{{ horizon_lib_dir }}/openstack_dashboard/{{ item.value.theme_path }}/"
owner: "{{ horizon_system_user_name }}"
group: "{{ horizon_system_group_name }}"
with_dict: "{{ horizon_custom_themes }}"
when: item.value.theme_src_archive is defined
notify: Restart apache2
- name: Compile messages for translation
command: "{{ horizon_manage }} compilemessages"
become: yes