puppet-httpd/pkg/puppetlabs-apache-0.0.3/manifests/vhost.pp

39 lines
1001 B
Puppet

# Definition: apache::vhost
#
# This class installs Apache Virtual Hosts
#
# Parameters:
# - The $port to configure the host on
# - The $docroot provides the DocumentationRoot variable
# - The $ssl option is set true or false to enable SSL for this Virtual Host
# - The $template option specifies whether to use the default template or override
# - The $priority of the site
# - The $serveraliases of the site
#
# Actions:
# - Install Apache Virtual Hosts
#
# Requires:
# - The apache class
#
# Sample Usage:
# apache::vhost { 'site.name.fqdn':
# priority => '20',
# port => '80',
# docroot => '/path/to/docroot',
# }
#
define apache::vhost( $port, $docroot, $ssl=true, $template='apache/vhost-default.conf.erb', $priority, $serveraliases = '' ) {
include apache
file {"${apache::params::vdir}/${priority}-${name}":
content => template($template),
owner => 'root',
group => 'root',
mode => '777',
require => Package['httpd'],
notify => Service['httpd'],
}
}