From 57b904839be4455363576503cae43fae84c98781 Mon Sep 17 00:00:00 2001 From: Gary Larizza Date: Fri, 15 Jul 2011 15:27:50 -0700 Subject: [PATCH] Commit apache::vhost::redirect Manifest --- manifests/vhost/redirect.pp | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 manifests/vhost/redirect.pp diff --git a/manifests/vhost/redirect.pp b/manifests/vhost/redirect.pp new file mode 100644 index 0000000..ed4a55f --- /dev/null +++ b/manifests/vhost/redirect.pp @@ -0,0 +1,50 @@ +# Define: apache::vhost::redirect +# +# This class will create a vhost that does nothing more than redirect to a given location +# +# Parameters: +# $port: +# Which port to list on +# $dest: +# Where to redirect to +# - $vhost_name +# +# Actions: +# Installs apache and creates a vhost +# +# Requires: +# +# Sample Usage: +# +define apache::vhost::redirect ( + $port, + $dest, + $priority = '10', + $serveraliases = '', + $template = "apache/vhost-redirect.conf.erb", + $vhost_name = '*' + ) { + + include apache + + $srvname = $name + + file {"${apache::params::vdir}/${priority}-${name}": + 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' + } + } +} +