From 6cf7312ff3267acc34d48b948df0be1633e3d683 Mon Sep 17 00:00:00 2001 From: Gary Larizza Date: Fri, 15 Jul 2011 15:25:31 -0700 Subject: [PATCH] Defaults for Parameters Set sane default parameters for the apache::vhost subclass and enter them into apache::params. --- manifests/params.pp | 16 ++++++++++++---- manifests/vhost.pp | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 9764001..8012fdc 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -18,9 +18,18 @@ # class apache::params { - $user = 'www-data' - $group = 'www-data' - + $user = 'www-data' + $group = 'www-data' + $ssl = 'true' + $template = 'apache/vhost-default.conf.erb' + $priority = '25' + $servername = '' + $serveraliases = '' + $auth = false + $redirect_ssl = false + $options = 'Indexes FollowSymLinks MultiViews' + $vhost_name = '*' + case $operatingsystem { 'centos', 'redhat', 'fedora': { $apache_name = 'httpd' @@ -32,7 +41,6 @@ class apache::params { 'ubuntu', 'debian': { $apache_name = 'apache2' $php_package = 'libapache2-mod-php5' - $python_package = 'libapache2-mod-python' $ssl_package = 'apache-ssl' $apache_dev = [ 'libaprutil1-dev', 'libapr1-dev', 'apache2-prefork-dev' ] $vdir = '/etc/apache2/sites-enabled/' diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 6a61d23..1bcd3d4 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -9,6 +9,8 @@ # - The $template option specifies whether to use the default template or override # - The $priority of the site # - The $serveraliases of the site +# - The $options for the given vhost +# - The $vhost_name for name based virtualhosting, defaulting to * # # Actions: # - Install Apache Virtual Hosts @@ -23,7 +25,19 @@ # docroot => '/path/to/docroot', # } # -define apache::vhost( $port, $docroot, $ssl=true, $template='apache/vhost-default.conf.erb', $priority, $serveraliases = '' ) { +define apache::vhost( + $port, + $docroot, + $ssl = $apache::params::ssl, + $template = $apache::params::template, + $priority = $apache::params::priority, + $servername = $apache::params::servername, + $serveraliases = $apache::params::serveraliases, + $auth = $apache::params::auth, + $redirect_ssl = $apache::params::redirect_ssl, + $options = $apache::params::options, + $vhost_name = $apache::params::vhost_name + ) { include apache