Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apache::vhost ProxyPassMatch in Location containers #2222

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
87cc5f0
test for proxy_pass_match in proxy dictionary, use ProxyPassMatch ins…
skylar2-uw Mar 24, 2022
66cef3d
Puppet String update
skylar2-uw Mar 24, 2022
5bff371
test case
skylar2-uw Mar 24, 2022
16f9aba
Puppet String
skylar2-uw Mar 24, 2022
7a29a2a
Merge branch 'puppetlabs:main' into apache_vhost_proxy_pass_match_dir…
skylar2-uw May 12, 2022
8b5a39c
Set the Apache version to 2.4 in FreeBSD acceptance
ekohl Mar 7, 2022
d6c62d5
Drop Apache 2.2 support with Gentoo
ekohl Mar 7, 2022
c6f11ad
(GH-iac-334) Remove code specific to unsupported OSs
david22swan Mar 25, 2022
faaa24d
(maint) Temporary disable of syntax checks to allow work to go through
david22swan Mar 25, 2022
1530d9a
(MAINT) Add labeller and stale GHA workflows
chelnak Mar 25, 2022
fdbbe20
(MAINT) Fixes no new line at EOF
chelnak Mar 25, 2022
92163f1
"This commit changes the workflow trigger for pull requests to pull_r…
chelnak Apr 4, 2022
74f6e0c
Restructure MPM disabling
ekohl Mar 29, 2022
86c852c
Drop Apache 2.0 compatibility code
ekohl Mar 29, 2022
395a086
Add support for PassengerPreloadBundler
smortex Apr 4, 2022
722f020
Fix CI
smortex Apr 4, 2022
c979092
Remove warnings and plans to change vhost default naming
ekohl Oct 11, 2021
ce7b59f
(maint) PDK Update
david22swan Apr 20, 2022
4750870
(maint) syntax:hiera:yaml fixes
david22swan Apr 20, 2022
a5b06d3
(maint) Rubocop Fixes
david22swan Apr 20, 2022
2472c02
(GH-cat-9) syntax:hiera:yaml exclusions added
david22swan Apr 20, 2022
a3f10e6
init.pp: fix typo in purge_vdir documentation
kenyon Nov 14, 2021
6f28430
mod_auth_gssapi: Add support for GssapiBasicAuth.
olifre Feb 8, 2022
03d8f76
mod_auth_gssapi: Improve indentation in vhost/_gssapi template.
olifre Feb 8, 2022
4d1b89a
Merge branch 'apache_vhost_proxy_pass_match_directories' of github.co…
skylar2-uw May 12, 2022
65c169e
change test case to use proxy_pass_match rather than proxy_pass
skylar2-uw May 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,8 @@
# Values: `directory`, `files`, `proxy`, `location`, `directorymatch`, `filesmatch`,
# `proxymatch` or `locationmatch`. If you set `provider` to `directorymatch`, it
# uses the keyword `DirectoryMatch` in the Apache config file.<br />
# proxy_pass and proxy_pass_match are supported like their parameters to apache::vhost, and will
# be rendered without their path parameter as this will be inherited from the Location/LocationMatch container.
# An example use of `directories`:
# ``` puppet
# apache::vhost { 'files.example.net':
Expand Down
19 changes: 19 additions & 0 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,20 @@
},
],
},
{
'path' => '^/proxy',
'provider' => 'locationmatch',
'proxy_pass_match' => [
{
'url' => 'http://backend-b/',
'keywords' => ['noquery', 'interpolate'],
'params' => {
'retry' => '0',
'timeout' => '5',
},
},
],
},
{
'path' => '/var/www/node-app/public',
'passenger_enabled' => true,
Expand Down Expand Up @@ -696,6 +710,11 @@
content: %r{^\s+ProxyPass http://backend-b/ retry=0 timeout=5 noquery interpolate$},
)
}
it {
is_expected.to contain_concat__fragment('rspec.example.com-directories').with(
content: %r{^\s+ProxyPassMatch http://backend-b/ retry=0 timeout=5 noquery interpolate$},
)
}
it {
is_expected.to contain_concat__fragment('rspec.example.com-directories').with(
content: %r{^\s+Options\sIndexes\sFollowSymLinks\sMultiViews$},
Expand Down
14 changes: 11 additions & 3 deletions templates/vhost/_directories.erb
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,17 @@
<%- end -%>
<%- end -%>
<%- end -%>
<%- if directory['proxy_pass'] and directory['provider'] and directory['provider'].match('location') -%>
<%- directory['proxy_pass'].flatten.compact.each do |proxy| -%>
ProxyPass <%= proxy['url'] -%>
<%- if (directory['proxy_pass'] or directory['proxy_pass_match']) and directory['provider'] and directory['provider'].match('location') -%>
<%# In a Location container, only one of ProxyPass or ProxyPassMatch are allowed, so only need to handle on case at a time -%>
<%- if directory['proxy_pass_match']
proxy_pass = 'ProxyPassMatch'
directory_proxy_pass = directory['proxy_pass_match']
else
proxy_pass = 'ProxyPass'
directory_proxy_pass = directory['proxy_pass']
end -%>
<%- directory_proxy_pass.flatten.compact.each do |proxy| -%>
<%= proxy_pass -%> <%= proxy['url'] -%>
<%- if proxy['params'] -%>
<%- proxy['params'].keys.sort.each do |key| -%> <%= key %>=<%= proxy['params'][key] -%>
<%- end -%>
Expand Down