-
-
Notifications
You must be signed in to change notification settings - Fork 881
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 confd_only option #878
Conversation
Also, if folks think it's better, I could try to consolidate the logic in these two spots, if someone can suggest a better way or place to do this. Additionally, if there's a better way to have the precondition |
Rebased to handle a couple conflicts, and also updated it to handle conf.stream.d |
I also added some additional tests related to streams here. |
context 'when vhost_purge false' do | ||
let(:params) { { vhost_purge: false } } | ||
let(:params) { { vhost_purge: false, stream: true } } |
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.
please convert to do/end block (because there are multiple attributes in the hash.
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.
I just got rid of $stream since it didn't look like it's actually doing anything useful
end | ||
|
||
context 'when stream true and confd_only true' do | ||
let(:params) { { stream: true, confd_only: true } } |
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.
same here, do/end please.
@bastelfreak: the recent changes (removing $stream variable) should resolve the feedback above. |
Ran acceptance tests (CentOS 6, Ubuntu 14) and look Ok. Closed / reopened just to see if Travis is any less cranky now. |
@wyardley You do not need to close / reopen the PR to trigger a build at TravisCI. Just login at TravisCI via GitHub and push the "Restart build" button. But it looks like a timeout at:
|
@dhoppe: Didn't know I had permission to restart jobs. |
@wyardley Take a look at #918. It looks like this is some sort of issue with |
Also, does it seem to make sense to have $vhost_purge affect the streams files as well? Or should it be limited only to vhosts? @bastelfreak: the changes you requested should be resolved now. Would appreciate any other discussion about this feature, or any reservations folks have about the premise of it. Streams functionality is still broken; it may make sense to re-enable the $streams parameter, but it would need to go along with fixing it (currently, the files aren't even included). So if this is merged, I can happily make a new PR to replace / update the existing ones for fixing that.. #790, #782, etc. |
# Err on the side of caution - make sure *both* $vhost_purge and | ||
# $confd_purge are set if $confd_only is set, before purging files | ||
# ${conf_dir}/conf.d | ||
if (($confd_only and $vhost_purge) or !$confd_only) { |
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.
note to myself: we really need a styleguide for this
Add confd_only option
Add confd_only option
This PR adds an option
$confd_only
(defaulting to false), that avoids using the Ubuntu style$conf_dir/sites-{available,enabled}
mechanism with symlinks. Obviously, the current way works, but I don't personally prefer it; also, presumably one is using Puppet to manage configs in a lot of scenarios, so on platforms where this convention isn't used, or when managing all of the nginx configs through Puppet, the symlinks don't really gain you much advantage.A couple notes:
$conf_dir/sites-{available,enabled}
won't be forced to be present or absent$confd_only
set, both$vhost_purge
and$confd_purge
must be set, otherwise, it will silently not purge (I can make it fail in that case if folks think it's cleaner).sites-enabled
dir will also not be included in the main nginx.confI can't tell where the main configurable params of the module are documented; the resources have their parameters documented, but init.pp and config.pp don't seem to have the main params documented. But the caveat above should probably be documented somewhere.
Happy for suggestions of improvements, or about making the style more consistent (I purposely didn't use the
if $foo == true
style used elsewhere in the module for things that are already verified as booleans, though I didn't change existing cases) or improve test coverage further.