Commit apache::vhost::redirect Manifest
This commit is contained in:
parent
8862d013e6
commit
57b904839b
50
manifests/vhost/redirect.pp
Normal file
50
manifests/vhost/redirect.pp
Normal file
@ -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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user