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 fastcgi_param parameter to vhost resource #956

Merged
merged 1 commit into from Nov 1, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions manifests/resource/vhost.pp
Expand Up @@ -46,6 +46,7 @@
# [*resolver*] - Array: Configures name servers used to resolve
# names of upstream servers into addresses.
# [*fastcgi*] - location of fastcgi (host:port)
# [*fastcgi_param*] - Set additional custom fastcgi_params
# [*fastcgi_params*] - optional alternative fastcgi_params file to use
# [*fastcgi_script*] - optional SCRIPT_FILE parameter
# [*uwsgi_read_timeout*] - optional value for uwsgi_read_timeout
Expand Down Expand Up @@ -248,6 +249,7 @@
$proxy_buffering = undef,
$resolver = [],
$fastcgi = undef,
$fastcgi_param = undef,
$fastcgi_params = "${::nginx::config::conf_dir}/fastcgi_params",
$fastcgi_script = undef,
$uwsgi = undef,
Expand Down Expand Up @@ -645,6 +647,7 @@
proxy_set_body => $proxy_set_body,
proxy_buffering => $proxy_buffering,
fastcgi => $fastcgi,
fastcgi_param => $fastcgi_param,
fastcgi_params => $fastcgi_params,
fastcgi_script => $fastcgi_script,
uwsgi => $uwsgi,
Expand Down
8 changes: 8 additions & 0 deletions spec/defines/resource_vhost_spec.rb
Expand Up @@ -948,6 +948,14 @@
it { is_expected.to contain_file('/etc/nginx/fastcgi_params').with_mode('0770') }
end

context 'when fastcgi_param => {key => value}' do
let :params do
default_params.merge(fastcgi_param: { 'key' => 'value' })
end

it { is_expected.to contain_nginx__resource__location("#{title}-default").with_fastcgi_param('key' => 'value') }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to check for vhost, not location, and I think you'll be looking at the template fragments.

end

context 'when uwsgi => "uwsgi_upstream"' do
let :params do
default_params.merge(uwsgi: 'uwsgi_upstream')
Expand Down