-
-
Notifications
You must be signed in to change notification settings - Fork 875
Add fastcgi_param parameter to vhost resource #956
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
Conversation
This seems sane to me, but you'll need to add tests in |
Tests added. Let me know if thats not enough. |
Hmm, I'm not used to rubocop. Any idea what I've done wrong? The log doesn't load here. |
@xaque208 Yeah, it can be kind of a hassle. Basically, before pushing, try to run: Currently, the complaints I see are:
You don't need to test all the things from the example in location, but I'd test for absence when unset, and then test for presence of multiple variables, similar to what's done in the location example. Also, you'll need to validate the parameter, right before:
|
Alright, thank you for the information. I just run |
default_params.merge(fastcgi_param: {'key' => 'value'}) | ||
end | ||
|
||
it { is_expected.to contain_nginx__resource__location("#{title}-default").with_fastcgi_param('key' => 'value') } |
There was a problem hiding this comment.
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.
You're also not actually putting the parameters into any templates, and you're testing the wrong thing (nginx__resource__location). Location does it a bit differently than we'd want to do it for vhost, see: puppet-nginx/manifests/resource/location.pp Lines 374 to 391 in f298908
puppet-nginx/templates/vhost/locations/fastcgi.erb Lines 17 to 21 in f298908
The location manifest needs to change, but currently, it will use one of several templates, which causes some other problems. For vhost I think, you'll probably want to put in both of: https://github.com/voxpupuli/puppet-nginx/blob/master/templates/vhost/vhost_footer.erb#L5 |
I'm building 2.3.1 locally for testing rubocop, so I'll sort that out in a moment. For the testing you mention, I don't believe I'm testing the wrong thing. Specifically what I'm testing, is that when you specify the $fastcgi_param parameter on the That said, Is there a different change I should be making? I'm under the assumption here that the location created by default for every vhost when |
Without this change, specifying fastcgi parameters are not possible on the vhost. This change modifies vhost resource to allow passing the fastcgi_param to the location resource directly, as is the case with a few of the other fastcgi related parameters.
I've rubocop'd like a pro. Hooray! |
I still want to make sure this is the right change to make, so if my thinking above is off, please correct me. |
I see what it's doing now and how (with the default location). I did find it a little confusing that it's in a different scope, but in any event, this is merged, and does behave the same way some similar / related params do. Thanks for fixing the Rubocop warnings. |
Great, thank you @wyardley |
Add fastcgi_param parameter to vhost resource
Add fastcgi_param parameter to vhost resource
Without this change, specifying fastcgi parameters are not possible on
the vhost. This change modifies vhost resource to allow passing the
fastcgi_param to the location resource directly, as is the case with a
few of the other fastcgi related parameters.