Skip to content

Commit

Permalink
Vhost File Declarations
Browse files Browse the repository at this point in the history
Include apache::vhost file declarations and templates.
  • Loading branch information
Gary Larizza committed Jul 15, 2011
1 parent 6cf7312 commit 9a51b4a
Showing 1 changed file with 38 additions and 7 deletions.
45 changes: 38 additions & 7 deletions manifests/vhost.pp
Expand Up @@ -41,12 +41,43 @@

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'
}
}
}

0 comments on commit 9a51b4a

Please sign in to comment.