diff --git a/manifests/init.pp b/manifests/init.pp index c222802..e639931 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -89,6 +89,8 @@ class drupal ( $site_ssl_key_file_contents = undef, $site_vhost_root = '/srv/vhosts', ) { + # Dependencies + require ::drupal::params include ::httpd include ::pear @@ -151,6 +153,9 @@ class drupal ( mode => '0755', } + # Check vhost permission set. + $new_vhost_perms = (versioncmp($::drupal::params::apache_version, '2.4') >= 0) + ::httpd::vhost { $site_name: port => 80, priority => '50', diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..60f6266 --- /dev/null +++ b/manifests/params.pp @@ -0,0 +1,18 @@ +# == Class: drupal::params +# +# Centralized configuration management for the drupal module. +# +class drupal::params() { + case $::osfamily { + 'Debian': { + if $::operatingsystem == 'Ubuntu' and $::operatingsystemrelease >= 13.10 { + $apache_version = '2.4' + } else { + $apache_version = '2.2' + } + } + default: { + fail("Unsupported osfamily: ${::osfamily} The 'storyboard' module only supports osfamily Debian.") + } + } +} diff --git a/templates/drupal.vhost.erb b/templates/drupal.vhost.erb index 125bc61..0994621 100644 --- a/templates/drupal.vhost.erb +++ b/templates/drupal.vhost.erb @@ -30,8 +30,12 @@ NameVirtualHost <%= @vhost_name %>:443 > Options FollowSymLinks MultiViews AllowOverride None - Order allow,deny - allow from all + <% if @new_vhost_perms %> + Require all granted + <% else %> + Order allow,deny + Allow from all + <% end %> # Protect files and directories from prying eyes. Order allow,deny