Fix site directory defaults for apache 2.4

With the 2.4 release the site config for directies was changed as
noted in the bug link.  If necessary, in the future we could create
a list attribute to hold the directory options to allow them to be
overrideable, but no one has asked for that yet.  This could also
use the apache cookbook web_app provider to create this site config.
Also cleaned up some minor formatting in the specs.

Change-Id: Ie2b323ac055ae03b3c4ebb28b70aca65745df842
Closes-Bug: #1411772
This commit is contained in:
Mark Vanderwiel 2015-01-16 12:46:52 -06:00
parent ad7957e5d7
commit 7886c81a74
5 changed files with 30 additions and 11 deletions

View File

@ -21,6 +21,7 @@ This file is used to list changes made in each version of the openstack-dashboar
* Allow TraceEnable to be configured
* Allow volume_api_version to be configured for Horizon
* Allow webserver to be configurable
* Fix site template directory defaults for apache 2.4
## 9.1
* python_packages database client attributes have been moved to the -common cookbook

View File

@ -284,6 +284,17 @@ describe 'openstack-dashboard::apache2-server' do
end
end
context 'directory options' do
it 'sets default options for apache 2.2' do
expect(chef_run).to render_file(file.name).with_content(/^\s*Order allow,deny\n\s*allow from all$/)
end
it 'sets default options for apache 2.4' do
node.set['apache']['version'] = '2.4'
expect(chef_run).to render_file(file.name).with_content(/^\s*Require all granted$/)
end
end
context 'log directives' do
before do
node.set['apache']['log_dir'] = 'log_dir_value'

View File

@ -50,7 +50,6 @@ describe 'openstack-dashboard::horizon' do
end
it 'does not remove openstack-dashboard-ubuntu-theme package' do
expect(chef_run).not_to purge_package('openstack-dashboard-ubuntu-theme')
end
end

View File

@ -57,13 +57,13 @@ describe 'openstack-dashboard::horizon' do
it 'does not execute openstack-dashboard syncdb by default' do
cmd = 'python manage.py syncdb --noinput'
expect(chef_run).not_to run_execute(cmd).with(
cwd: '/srv/www/openstack-dashboard',
environment: {
'PYTHONPATH' => '/etc/openstack-dashboard:' \
'/srv/www/openstack-dashboard:' \
'$PYTHONPATH'
cwd: '/srv/www/openstack-dashboard',
environment: {
'PYTHONPATH' => '/etc/openstack-dashboard:' \
'/srv/www/openstack-dashboard:' \
'$PYTHONPATH'
}
)
)
end
end
end

View File

@ -44,15 +44,23 @@ NameVirtualHost *:<%= node['openstack']['dashboard']['https_port'].to_i%>
<Directory <%= node["openstack"]["dashboard"]["dash_path"] %>>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
<% if node['apache']['version'] == '2.4' -%>
Require all granted
<% else -%>
Order allow,deny
allow from all
<% end -%>
</Directory>
<Directory <%= node["openstack"]["dashboard"]["static_path"] %>>
Options FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
Options FollowSymLinks MultiViews
AllowOverride None
<% if node['apache']['version'] == '2.4' -%>
Require all granted
<% else -%>
Order allow,deny
allow from all
<% end -%>
</Directory>
<% if node["openstack"]["dashboard"]["use_ssl"] %>