
This renames the classes and defined types from apache to httpd. With the 'httpd' module available, we can migrate usage of 'apache' to 'httpd.' Eventually this will free the 'apache' namespace. A native ruby type and provider is contained in this class. It is not namespaced to the class name so it has been renamed from a2mod to httpd_mod. Change-Id: I056eb28a13e7ccc95f1496019bedc332c17dd458
53 lines
1021 B
Puppet
53 lines
1021 B
Puppet
# Define: httpd::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 httpd::vhost::redirect (
|
|
$port,
|
|
$dest,
|
|
$priority = '10',
|
|
$serveraliases = '',
|
|
$template = 'httpd/vhost-redirect.conf.erb',
|
|
$vhost_name = '*'
|
|
) {
|
|
|
|
include httpd
|
|
|
|
$srvname = $name
|
|
|
|
file { "${priority}-${name}":
|
|
path => "${httpd::params::vdir}/${priority}-${name}",
|
|
content => template($template),
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
require => Package['httpd'],
|
|
notify => Service['httpd'],
|
|
}
|
|
|
|
if ! defined(Firewall["0100-INPUT ACCEPT ${port}"]) {
|
|
@firewall {
|
|
"0100-INPUT ACCEPT ${port}":
|
|
jump => 'ACCEPT',
|
|
dport => '$port',
|
|
proto => 'tcp'
|
|
}
|
|
}
|
|
}
|
|
|