apache: Added support for proxy http sites.
This commit is contained in:
parent
f9e719d33e
commit
945a9f2af3
4 changed files with 61 additions and 28 deletions
|
@ -154,6 +154,8 @@ class apache::server inherits apache::common {
|
|||
# Path to document root. Defaults to /srv/www/http/$fqdn
|
||||
# $redirect:
|
||||
# Add redirect to given URL.
|
||||
# $proxy:
|
||||
# Proxy site to given URL.
|
||||
#
|
||||
# === Sample usage
|
||||
#
|
||||
|
@ -163,8 +165,15 @@ class apache::server inherits apache::common {
|
|||
# apache::site { "www.example.com":
|
||||
# root => "/roles/prteam/public/public_access",
|
||||
# }
|
||||
# apache::site { "www2.example.com":
|
||||
# proxy => "http://www.example.com",
|
||||
# }
|
||||
#
|
||||
define apache::site($aliases="", $root="", $redirect="") {
|
||||
define apache::site($aliases="", $root="", $redirect="", $proxy="") {
|
||||
|
||||
if $redirect and $proxy {
|
||||
fail("cannot define both \$redirect and \$proxy for apache::site (${name})")
|
||||
}
|
||||
|
||||
case $::operatingsystem {
|
||||
"debian","ubuntu": {
|
||||
|
@ -172,6 +181,7 @@ define apache::site($aliases="", $root="", $redirect="") {
|
|||
aliases => $aliases,
|
||||
root => $root,
|
||||
redirect => $redirect,
|
||||
proxy => $proxy,
|
||||
}
|
||||
}
|
||||
"centos","redhat","fedora": {
|
||||
|
@ -179,6 +189,7 @@ define apache::site($aliases="", $root="", $redirect="") {
|
|||
aliases => $aliases,
|
||||
root => $root,
|
||||
redirect => $redirect,
|
||||
proxy => $proxy,
|
||||
}
|
||||
}
|
||||
default: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue