[ui] Add option to configure apache expires
For tripleo-ui files served by apache Change-Id: I23baca51069f11007e7d4ba7d05c62ed05b7071b
This commit is contained in:

committed by
Alex Schultz

parent
a82b6c8a6f
commit
4f82b2eb9b
@@ -108,6 +108,12 @@
|
||||
# List of enabled loggers
|
||||
# Defaults to ['console', 'zaqar']
|
||||
#
|
||||
# [*httpd_expires*]
|
||||
# A list of strings passed to ::apache::vhost::directories::expires_by_type
|
||||
# [
|
||||
# 'text/javascript "access plus 1 months"'
|
||||
# ]
|
||||
#
|
||||
class tripleo::ui (
|
||||
$servername = $::fqdn,
|
||||
$bind_host = hiera('controller_host'),
|
||||
@@ -131,6 +137,9 @@ class tripleo::ui (
|
||||
$endpoint_config_nova = undef,
|
||||
$endpoint_config_swift = undef,
|
||||
$enabled_loggers = ['console', 'zaqar'],
|
||||
$httpd_expires = [
|
||||
'text/javascript "access plus 1 months"'
|
||||
]
|
||||
|
||||
) {
|
||||
package {'openstack-tripleo-ui': }
|
||||
@@ -149,6 +158,15 @@ class tripleo::ui (
|
||||
docroot => '/var/www/openstack-tripleo-ui/dist',
|
||||
options => ['Indexes', 'FollowSymLinks'],
|
||||
fallbackresource => '/index.html',
|
||||
directories => [
|
||||
{
|
||||
path => '/var/www/openstack-tripleo-ui/dist',
|
||||
provider => 'directory',
|
||||
options => ['Indexes', 'FollowSymLinks'],
|
||||
expires_active => bool2str(!empty($httpd_expires), 'On', 'Off'),
|
||||
expires_by_type => $httpd_expires
|
||||
}
|
||||
],
|
||||
proxy_pass => [
|
||||
{
|
||||
'path' => '/zaqar',
|
||||
|
@@ -49,9 +49,21 @@ describe 'tripleo::ui' do
|
||||
:port => 3000,
|
||||
:docroot => '/var/www/openstack-tripleo-ui/dist',
|
||||
:options => [ 'Indexes', 'FollowSymLinks' ],
|
||||
:fallbackresource => '/index.html'
|
||||
:fallbackresource => '/index.html',
|
||||
:directories => [
|
||||
{
|
||||
"path" => '/var/www/openstack-tripleo-ui/dist',
|
||||
"provider" => 'directory',
|
||||
"options" => ['Indexes', 'FollowSymLinks'],
|
||||
"expires_active" => 'On',
|
||||
"expires_by_type" => [
|
||||
'text/javascript "access plus 1 months"'
|
||||
]
|
||||
}
|
||||
]
|
||||
)
|
||||
is_expected.to contain_file('/etc/httpd/conf.d/openstack-tripleo-ui.conf').with_content(/cleaned by Puppet/)
|
||||
is_expected.to contain_file('/etc/httpd/conf.d/openstack-tripleo-ui.conf')
|
||||
.with_content(/cleaned by Puppet/)
|
||||
is_expected.to contain_file('/var/www/openstack-tripleo-ui/dist/tripleo_ui_config.js')
|
||||
.with_content(/'keystone': 'https:\/\/127.0.0.1:443\/keystone\/v2.0'/)
|
||||
.with_content(/'heat': 'https:\/\/127.0.0.1:443\/heat\/v1\/%\(tenant_id\)s'/)
|
||||
|
Reference in New Issue
Block a user