Vhost File Declarations

Include apache::vhost file declarations and templates.
This commit is contained in:
Gary Larizza 2011-07-15 15:26:22 -07:00
parent 6cf7312ff3
commit 9a51b4aa8d

View File

@ -41,12 +41,43 @@ define apache::vhost(
include apache
file {"${apache::params::vdir}/${priority}-${name}":
content => template($template),
owner => 'root',
group => 'root',
mode => '777',
require => Package['httpd'],
notify => Service['httpd'],
if $servername == '' {
$srvname = $name
} else {
$srvname = $servername
}
if $ssl == true {
include apache::ssl
}
# Since the template will use auth, redirect to https requires mod_rewrite
if $redirect_ssl == true {
case $operatingsystem {
'debian','ubuntu': {
A2mod <| title == 'rewrite' |>
}
default: { }
}
}
file {
"${apache::params::vdir}/${priority}-${name}.conf":
content => template($template),
owner => 'root',
group => 'root',
mode => '755',
require => Package['httpd'],
notify => Service['httpd'],
}
if ! defined(Firewall["0100-INPUT ACCEPT $port"]) {
@firewall {
"0100-INPUT ACCEPT $port":
jump => 'ACCEPT',
dport => "$port",
proto => 'tcp'
}
}
}