change variable names as requested to match nginx params exactly... Also passenger_env_var is not set with passenger_set_env_var and this commit undoes that

This commit is contained in:
Michael Marod 2015-04-29 17:37:58 -04:00
parent d0464923d1
commit 7e524d0785
4 changed files with 23 additions and 23 deletions

View file

@ -127,7 +127,7 @@
# options like error level to the end.
# [*passenger_cgi_param*] - Allows one to define additional CGI environment
# variables to pass to the backend application
# [*passenger_header*] - Allows one to set headers to pass to the
# [*passenger_set_header*] - Allows one to set headers to pass to the
# backend application (Passenger 5.0+)
# [*passenger_env_var*] - Allows one to set environemnt variables to pass
# to the backend application (Passenger 5.0+)
@ -231,7 +231,7 @@ define nginx::resource::vhost (
$error_log = undef,
$format_log = 'combined',
$passenger_cgi_param = undef,
$passenger_header = undef,
$passenger_set_header = undef,
$passenger_env_var = undef,
$log_by_lua = undef,
$log_by_lua_file = undef,
@ -414,8 +414,8 @@ define nginx::resource::vhost (
if ($passenger_cgi_param != undef) {
validate_hash($passenger_cgi_param)
}
if ($passenger_header != undef) {
validate_hash($passenger_header)
if ($passenger_set_header != undef) {
validate_hash($passenger_set_header)
}
if ($passenger_env_var != undef) {
validate_hash($passenger_env_var)

View file

@ -853,9 +853,9 @@ describe 'nginx::resource::vhost' do
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content( /passenger_set_cgi_param test3 test value 3;/ ) }
end
context 'when passenger_header is set' do
context 'when passenger_set_header is set' do
let :params do default_params.merge({
:passenger_header => { 'test1' => 'test value 1', 'test2' => 'test value 2', 'test3' => 'test value 3' }
:passenger_set_header => { 'test1' => 'test value 1', 'test2' => 'test value 2', 'test3' => 'test value 3' }
}) end
it { is_expected.to contain_concat__fragment("#{title}-header").with_content( /passenger_set_header test1 test value 1;/ ) }
@ -863,12 +863,12 @@ describe 'nginx::resource::vhost' do
it { is_expected.to contain_concat__fragment("#{title}-header").with_content( /passenger_set_header test3 test value 3;/ ) }
end
context 'when passenger_header is set and ssl => true' do
context 'when passenger_set_header is set and ssl => true' do
let :params do default_params.merge({
:passenger_header => { 'test1' => 'test value 1', 'test2' => 'test value 2', 'test3' => 'test value 3' },
:ssl => true,
:ssl_key => 'dummy.key',
:ssl_cert => 'dummy.cert',
:passenger_set_header => { 'test1' => 'test value 1', 'test2' => 'test value 2', 'test3' => 'test value 3' },
:ssl => true,
:ssl_key => 'dummy.key',
:ssl_cert => 'dummy.cert',
}) end
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content( /passenger_set_header test1 test value 1;/ ) }
@ -881,9 +881,9 @@ describe 'nginx::resource::vhost' do
:passenger_env_var => { 'test1' => 'test value 1', 'test2' => 'test value 2', 'test3' => 'test value 3' }
}) end
it { is_expected.to contain_concat__fragment("#{title}-header").with_content( /passenger_set_env_var test1 test value 1;/ ) }
it { is_expected.to contain_concat__fragment("#{title}-header").with_content( /passenger_set_env_var test2 test value 2;/ ) }
it { is_expected.to contain_concat__fragment("#{title}-header").with_content( /passenger_set_env_var test3 test value 3;/ ) }
it { is_expected.to contain_concat__fragment("#{title}-header").with_content( /passenger_env_var test1 test value 1;/ ) }
it { is_expected.to contain_concat__fragment("#{title}-header").with_content( /passenger_env_var test2 test value 2;/ ) }
it { is_expected.to contain_concat__fragment("#{title}-header").with_content( /passenger_env_var test3 test value 3;/ ) }
end
context 'when passenger_env_var is set and ssl => true' do
@ -894,9 +894,9 @@ describe 'nginx::resource::vhost' do
:ssl_cert => 'dummy.cert',
}) end
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content( /passenger_set_env_var test1 test value 1;/ ) }
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content( /passenger_set_env_var test2 test value 2;/ ) }
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content( /passenger_set_env_var test3 test value 3;/ ) }
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content( /passenger_env_var test1 test value 1;/ ) }
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content( /passenger_env_var test2 test value 2;/ ) }
it { is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content( /passenger_env_var test3 test value 3;/ ) }
end
context 'when vhost name is sanitized' do

View file

@ -94,14 +94,14 @@ server {
passenger_set_cgi_param <%= key %> <%= @passenger_cgi_param[key] %>;
<%- end -%>
<% end -%>
<% if @passenger_header -%>
<%- @passenger_header.keys.sort.each do |key| -%>
passenger_set_header <%= key %> <%= @passenger_header[key] %>;
<% if @passenger_set_header -%>
<%- @passenger_set_header.keys.sort.each do |key| -%>
passenger_set_header <%= key %> <%= @passenger_set_header[key] %>;
<%- end -%>
<% end -%>
<% if @passenger_env_var -%>
<%- @passenger_env_var.keys.sort.each do |key| -%>
passenger_set_env_var <%= key %> <%= @passenger_env_var[key] %>;
passenger_env_var <%= key %> <%= @passenger_env_var[key] %>;
<%- end -%>
<% end -%>
<% if Array(@resolver).count > 0 -%>

View file

@ -152,11 +152,11 @@ server {
<% Array(@passenger_cgi_param).each do |key,value| -%>
passenger_set_cgi_param <%= key %> <%= value %>;
<% end -%>
<% Array(@passenger_header).each do |key,value| -%>
<% Array(@passenger_set_header).each do |key,value| -%>
passenger_set_header <%= key %> <%= value %>;
<% end -%>
<% Array(@passenger_env_var).each do |key,value| -%>
passenger_set_env_var <%= key %> <%= value %>;
passenger_env_var <%= key %> <%= value %>;
<% end -%>
<% Array(@add_header).each do |key,value| -%>
add_header <%= key %> <%= value %>;