-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathproxy.pp
47 lines (47 loc) · 1.41 KB
/
proxy.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# @summary
# Installs and configures `mod_proxy`.
#
# @param proxy_requests
# Enables forward (standard) proxy requests.
#
# @param allow_from
# IP address or list of IPs allowed to access proxy.
#
# @param package_name
# Name of the proxy package to install.
#
# @param proxy_via
# Set local IP address for outgoing proxy connections.
#
# @param proxy_timeout
# Network timeout for proxied requests.
#
# @param proxy_iobuffersize
# Set the size of internal data throughput buffer
#
# @see https://httpd.apache.org/docs/current/mod/mod_proxy.html for additional documentation.
#
class apache::mod::proxy (
String $proxy_requests = 'Off',
Optional[Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]]] $allow_from = undef,
Optional[String] $package_name = undef,
String $proxy_via = 'On',
Optional[Integer[0]] $proxy_timeout = undef,
Optional[String] $proxy_iobuffersize = undef,
) {
include apache
$_proxy_timeout = $apache::timeout
::apache::mod { 'proxy':
package => $package_name,
}
# Template uses $proxy_requests
file { 'proxy.conf':
ensure => file,
path => "${apache::mod_dir}/proxy.conf",
mode => $apache::file_mode,
content => template('apache/mod/proxy.conf.erb'),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
}
}