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

add $passenger_pre_start variable #880

Merged
merged 1 commit into from
Sep 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions manifests/resource/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@
# backend application (Passenger 5.0+)
# [*passenger_env_var*] - Allows one to set environemnt variables to pass
# to the backend application (Passenger 5.0+)
# [*passenger_pre_start*] - Allows setting a URL to pre-warm the host. Per
# Passenger docs, the "domain part of the URL" must match a value of
# server_name
# [*log_by_lua*] - Run the Lua source code inlined as the
# <lua-script-str> at the log request processing phase.
# This does not replace the current access logs, but runs after.
Expand Down Expand Up @@ -272,6 +275,7 @@
$passenger_cgi_param = undef,
$passenger_set_header = undef,
$passenger_env_var = undef,
$passenger_pre_start = undef,
$log_by_lua = undef,
$log_by_lua_file = undef,
$use_default_location = true,
Expand Down Expand Up @@ -511,6 +515,9 @@
if ($passenger_env_var != undef) {
validate_hash($passenger_env_var)
}
if ($passenger_pre_start != undef) {
validate_string($passenger_pre_start)
}
if ($log_by_lua != undef) {
validate_string($log_by_lua)
}
Expand Down
8 changes: 8 additions & 0 deletions spec/defines/resource_vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,14 @@
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{passenger_env_var test3 test value 3;}) }
end

context 'when passenger_pre_start is set' do
let :params do
default_params.merge(passenger_pre_start: 'http://example.com:80/test/me')
end

it { is_expected.to contain_concat__fragment("#{title}-footer").with_content(%r{passenger_pre_start http://example.com:80/test/me;}) }
end

context 'when vhost name is sanitized' do
let(:title) { 'www rspec-vhost com' }
let(:params) { default_params }
Expand Down
3 changes: 3 additions & 0 deletions templates/vhost/vhost_footer.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
<%= line %>
<% end -%>
}
<% if @passenger_pre_start -%>
passenger_pre_start <%= @passenger_pre_start %>;
<% end -%>