
In anticipation of puppet 4, start trying to deal with puppet 4 things that can be helpfully predicted by puppet lint plugins. Also fix errors caught by the puppet-lint-unquoted_string-check and puppet-lint-absolute_classname-check gems. Change-Id: I9d74d25d2f2c95ec52a6db3bf070903240e1b933
58 lines
1.2 KiB
Puppet
58 lines
1.2 KiB
Puppet
# Define: httpd::vhost::proxy
|
|
#
|
|
# Configures an apache vhost that will only proxy requests
|
|
#
|
|
# Parameters:
|
|
# * $port:
|
|
# The port on which the vhost will respond
|
|
# * $dest:
|
|
# URI that the requests will be proxied for
|
|
# - $priority
|
|
# - $template -- the template to use for the vhost
|
|
# - $vhost_name - the name to use for the vhost, defaults to '*'
|
|
#
|
|
# Actions:
|
|
# * Install Apache Virtual Host
|
|
#
|
|
# Requires:
|
|
#
|
|
# Sample Usage:
|
|
#
|
|
define httpd::vhost::proxy (
|
|
$port,
|
|
$dest,
|
|
$priority = '10',
|
|
$template = 'httpd/vhost-proxy.conf.erb',
|
|
$servername = undef,
|
|
$serveraliases = undef,
|
|
$ssl = false,
|
|
$vhost_name = '*'
|
|
) {
|
|
|
|
include ::httpd
|
|
|
|
$apache_name = $httpd::params::apache_name
|
|
$ssl_path = $httpd::params::ssl_path
|
|
if $servername == undef {
|
|
$srvname = $name
|
|
} else {
|
|
$srvname = $servername
|
|
}
|
|
|
|
if $ssl == true {
|
|
include ::httpd::ssl
|
|
}
|
|
|
|
file { "${priority}-${name}":
|
|
path => "${httpd::params::vdir}/${priority}-${name}",
|
|
content => template($template),
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
require => Package['httpd'],
|
|
notify => Service['httpd'],
|
|
}
|
|
|
|
|
|
}
|