Skip to content

Commit 73adc51

Browse files
authored
Merge pull request #2366 from ekohl/bool2httpd
Simplify templates by reusing bool2httpd
2 parents 2220a02 + 6e4e1e6 commit 73adc51

File tree

3 files changed

+5
-25
lines changed

3 files changed

+5
-25
lines changed

templates/mod/authnz_ldap.conf.erb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<% if @verify_server_cert == true -%>
2-
LDAPVerifyServerCert On
3-
<% else -%>
4-
LDAPVerifyServerCert Off
5-
<% end -%>
1+
LDAPVerifyServerCert <%= scope.call_function('apache::bool2httpd', [@verify_server_cert]) %>

templates/mod/rpaf.conf.erb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ RPAFenable On
33
# RPAFsethostname will, when enabled, take the incoming X-Host header and
44
# update the virtual host settings accordingly. This allows to have the same
55
# hostnames as in the "real" configuration for the forwarding proxy.
6-
<% if @sethostname -%>
7-
RPAFsethostname On
8-
<% else -%>
9-
RPAFsethostname Off
10-
<% end -%>
6+
RPAFsethostname <%= scope.call_function('apache::bool2httpd', [@sethostname]) %>
117
# Which IPs are forwarding requests to us
128
RPAFproxy_ips <%= Array(@proxy_ips).join(" ") %>
139
# Setting RPAFheader allows you to change the header name to parse from the

templates/vhost/_proxy.erb

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
11
<% if @proxy_dest or @proxy_pass or @proxy_pass_match or @proxy_dest_match -%>
22

33
## Proxy rules
4-
<% if @proxy_requests -%>
5-
ProxyRequests On
6-
<% else -%>
7-
ProxyRequests Off
8-
<%- end -%>
9-
<%- end -%>
10-
<% if @proxy_preserve_host -%>
11-
ProxyPreserveHost On
12-
<% else -%>
13-
ProxyPreserveHost Off
4+
ProxyRequests <%= scope.call_function('apache::bool2httpd', @proxy_requests) %>
145
<%- end -%>
6+
ProxyPreserveHost <%= scope.call_function('apache::bool2httpd', @proxy_preserve_host) %>
157
<%- if defined?(@proxy_add_headers) -%>
16-
<%- if @proxy_add_headers -%>
17-
ProxyAddHeaders On
18-
<%- else -%>
19-
ProxyAddHeaders Off
20-
<%- end -%>
8+
ProxyAddHeaders <%= scope.call_function('apache::bool2httpd', @proxy_add_headers) %>
219
<%- end -%>
2210
<% if @proxy_error_override -%>
2311
ProxyErrorOverride On

0 commit comments

Comments
 (0)