@@ -46,79 +46,35 @@ Further reading:
46
46
* https://docs.openstack.org/horizon/latest/configuration/themes.html
47
47
* https://docs.openstack.org/horizon/latest/configuration/branding.html
48
48
49
- Building a Horizon container image with custom theme
50
- ----------------------------------------------------
49
+ Adding the custom theme
50
+ -----------------------
51
51
52
- Building a custom container image for Horizon can be done by modifying
53
- ``kolla.yml `` to fetch the custom theme and include it in the image:
52
+ Create a directory and transfer custom theme files to it ``$KAYOBE_CONFIG_PATH/kolla/config/horizon/themes/<custom theme name> ``.
54
53
55
- .. code-block :: yaml
56
-
57
- kolla_sources :
58
- horizon-additions-theme-<custom theme name> :
59
- type : " git"
60
- location : <custom theme repository url>
61
- reference : master
62
-
63
- kolla_build_blocks :
64
- horizon_footer : |
65
- # Binary images cannot use the additions mechanism.
66
- {% raw %}
67
- {% if install_type == 'source' %}
68
- ADD additions-archive /
69
- RUN mkdir -p /etc/openstack-dashboard/themes/<custom theme name> \
70
- && cp -R /additions/horizon-additions-theme-<custom theme name>-archive-master/* /etc/openstack-dashboard/themes/<custom theme name>/ \
71
- && chown -R horizon: /etc/openstack-dashboard/themes
72
- {% endif %}
73
- {% endraw %}
74
-
75
- If using a specific container image tag, don't forget to set:
54
+ Define the custom theme in ``etc/kayobe/kolla/globals.yml ``
76
55
77
56
.. code-block :: yaml
78
-
79
- kolla_tag : mytag
80
-
81
- Build the image with:
82
-
83
- .. code-block :: console
84
-
85
- kayobe overcloud container image build horizon -e kolla_install_type=source --push
86
-
87
- Pull the new Horizon container to the controller:
88
-
89
- .. code-block :: console
90
-
91
- kayobe overcloud container image pull --kolla-tags horizon
57
+ horizon_custom_themes :
58
+ - name : <custom theme name>
59
+ label : <custom theme label> # This will be the visible name to users
92
60
93
61
Deploy and use the custom theme
94
62
-------------------------------
95
63
96
- Switch to source image type in ``${KAYOBE_CONFIG_PATH}/kolla/globals.yml ``:
97
-
98
- .. code-block :: yaml
99
-
100
- horizon_install_type : source
101
-
102
- You may also need to update the container image tag:
103
-
104
- .. code-block :: yaml
105
-
106
- horizon_tag : mytag
107
-
108
64
Configure Horizon to include the custom theme and use it by default:
109
65
110
66
.. code-block :: console
111
67
112
- mkdir -p ${ KAYOBE_CONFIG_PATH} /kolla/config/horizon/
68
+ mkdir -p $KAYOBE_CONFIG_PATH/kolla/config/horizon/
113
69
114
- Add to ``${ KAYOBE_CONFIG_PATH} /kolla/config/horizon/custom_local_settings ``:
70
+ Create file ``$KAYOBE_CONFIG_PATH/kolla/config/horizon/custom_local_settings `` and add followings
115
71
116
72
.. code-block :: console
117
73
118
74
AVAILABLE_THEMES = [
119
75
('default', 'Default', 'themes/default'),
120
76
('material', 'Material', 'themes/material'),
121
- ('<custom theme name>', '<custom theme visible name >', '/etc/openstack-dashboard/ themes/<custom theme name>'),
77
+ ('<custom theme name>', '<custom theme label >', 'themes/<custom theme name>'),
122
78
]
123
79
DEFAULT_THEME = '<custom theme name>'
124
80
@@ -137,9 +93,6 @@ Deploy with:
137
93
Troubleshooting
138
94
---------------
139
95
140
- Make sure you build source images, as binary images cannot use the addition
141
- mechanism used here.
142
-
143
96
If the theme is selected but the logo doesn’t load, try running these commands
144
97
inside the ``horizon `` container:
145
98
0 commit comments