Defaults for Parameters

Set sane default parameters for the apache::vhost subclass
and enter them into apache::params.
This commit is contained in:
Gary Larizza 2011-07-15 15:25:31 -07:00
parent 6a5b11a4e0
commit 6cf7312ff3
2 changed files with 27 additions and 5 deletions

View File

@ -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/'

View File

@ -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