rcbops-cookbooks/horizon — pull request #135 by odyssey4me (2013-10-16 08:46:08+00:00)
Title: DE272 Provide more flexible theme customisation options

In this PR we provide a more flexible way of managing the Horizon theme, but also ensure that the current deployment of the 'Rackspace' theme is not broken.

We introduce the following lists of files to deploy:
node["horizon"]["theme_css_list"] & node["horizon"]["theme_image_list"]

And the following update styles:
"cookbook_list" will assume that the list of files are available as cookbook files
"download_list" will assume that the list of files must be downloaded from the appropriate base URL

And the following base URL's for downloading, when appropriate:
node["horizon"]["theme_image_base"] & node["horizon"]["theme_image_base"]

We also provide three theme styles:
'rs_stylesheets' has the stylesheet setup for the 'Rackspace' theme
'ubuntu_stylesheets' has the stylesheet setup for the 'ubuntu' theme
'default_stylesheets' includes the standard openstack theme style inclusions, but also provides for linking additions css files from the theme_css_list - this makes it ideal for simple customisations

An example of an environment override for a custom theme would be:

```json
"horizon": {
"theme": "default",
"theme_css_update_style": "download_list",
"theme_css_list": [ "custom_overlay.css" ],
"theme_css_base": "http://192.168.4.11/theme_files",
"theme_image_update_style": "download_list",
"theme_image_list": [ "custom_logo.png", "custom_favicon.ico" ],
"theme_image_base": "http://192.168.4.11/theme_files",
"config": {
"template_debug": true
}
}
```

I believe that this method of providing for customisations gives the deployer maximum flexibility without too much complexity.