Skip to content

Commit 33027f8

Browse files
committed
Fixes mod::proxy allow_from parameter inconsistency #2352
apache::mod::proxy allowed Stdlib::IP::Address as a class parameter, but proxy.conf.erb assumed it was an array.
1 parent 04d7b51 commit 33027f8

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

REFERENCE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5611,9 +5611,9 @@ Default value: `'Off'`
56115611

56125612
##### <a name="-apache--mod--proxy--allow_from"></a>`allow_from`
56135613

5614-
Data type: `Optional[Stdlib::IP::Address]`
5614+
Data type: `Optional[Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]]]`
56155615

5616-
List of IPs allowed to access proxy.
5616+
IP address or list of IPs allowed to access proxy.
56175617

56185618
Default value: `undef`
56195619

manifests/mod/proxy.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Enables forward (standard) proxy requests.
66
#
77
# @param allow_from
8-
# List of IPs allowed to access proxy.
8+
# IP address or list of IPs allowed to access proxy.
99
#
1010
# @param package_name
1111
# Name of the proxy package to install.
@@ -23,7 +23,7 @@
2323
#
2424
class apache::mod::proxy (
2525
String $proxy_requests = 'Off',
26-
Optional[Stdlib::IP::Address] $allow_from = undef,
26+
Optional[Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]]] $allow_from = undef,
2727
Optional[String] $package_name = undef,
2828
String $proxy_via = 'On',
2929
Optional[Integer[0]] $proxy_timeout = undef,

templates/mod/proxy.conf.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010

1111
<% if @proxy_requests != 'Off' or ( @allow_from and ! @allow_from.empty? ) -%>
1212
<Proxy *>
13+
<%- if @allow_from.is_a? Array -%>
1314
Require ip <%= @allow_from.join(" ") %>
15+
<%- else -%>
16+
Require ip <%= @allow_from %>
17+
<%- end -%>
1418
</Proxy>
1519
<% end -%>
1620

0 commit comments

Comments
 (0)