From 9a51b4aa8d652ebddfb3a9add394eb90cb91cf56 Mon Sep 17 00:00:00 2001 From: Gary Larizza Date: Fri, 15 Jul 2011 15:26:22 -0700 Subject: [PATCH] Vhost File Declarations Include apache::vhost file declarations and templates. --- manifests/vhost.pp | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 1bcd3d47dd..f3c669b00b 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -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' + } } } +