diff --git a/CHANGELOG.md b/CHANGELOG.md
index f480ad7..336abdc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/spec/apache2-server_spec.rb b/spec/apache2-server_spec.rb
index d263eda..7bae929 100644
--- a/spec/apache2-server_spec.rb
+++ b/spec/apache2-server_spec.rb
@@ -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'
diff --git a/spec/horizon-redhat_spec.rb b/spec/horizon-redhat_spec.rb
index 1e13807..a2e6c34 100644
--- a/spec/horizon-redhat_spec.rb
+++ b/spec/horizon-redhat_spec.rb
@@ -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
diff --git a/spec/horizon-suse_spec.rb b/spec/horizon-suse_spec.rb
index 2b6ae8b..ef0a492 100644
--- a/spec/horizon-suse_spec.rb
+++ b/spec/horizon-suse_spec.rb
@@ -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
diff --git a/templates/default/dash-site.erb b/templates/default/dash-site.erb
index 334a93e..fb0ae82 100644
--- a/templates/default/dash-site.erb
+++ b/templates/default/dash-site.erb
@@ -44,15 +44,23 @@ NameVirtualHost *:<%= node['openstack']['dashboard']['https_port'].to_i%>
>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
+ <% if node['apache']['version'] == '2.4' -%>
+ Require all granted
+ <% else -%>
Order allow,deny
allow from all
+ <% end -%>
>
- 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 -%>
<% if node["openstack"]["dashboard"]["use_ssl"] %>