-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
Fallback to monogb version from fact if no explicit version got provided #485
Conversation
Hi @fbrehm, thanks for the PR. Can you explain what you are trying to fix and take a look at the failing travis jobs? |
Hi Tim, I have tried to apply the module to a host with a running MongoDB 2.6.12. Unfortunately after applying there two options in the /etc/mongod.conf, which are mutually exclusive or deprecated: 'sslMode = requireSSL' and 'sslOnNormalPorts = true'. Because of this the mongod service was complaining and was stopped. After some research I found, that the Puppet module was using the wrong template, because the variable $version was not set. So I changed the file manifests/server/config.pp in this way to assign the custom fact 'mongodb_version' to $version, if $mongodb::server::version is not set or empty. Now the class was using the correct template 'mongodb/mongodb.conf.2.6.erb', and the mongod service was not complaining anymore and starting. I have seen the errors in your Jenkins job, and I think, they were caused, because the custom fact 'mongodb_version' was not available during the tests. Because of the lack in the knowledge about writing and executing puppet and/or Ruby tests on my side, I don't know, how to work around. Some help would be very appreciated. Cheers Frank |
manifests/server/config.pp
Outdated
$version = $mongodb::server::version | ||
|
||
if $mongodb::server::version == undef or $mongodb::server::version == '' { | ||
$version = $::mongodb_version |
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.
mongodb_version
is a fact, please access it via the facts
hash:
$facts['mongodb_version']
Made the changes - all tests seems to be okay |
Thanks! |
This breaks idempotency on setups and I want to revert this change. On the first run the fact is undef but on the second run it is defined causing a change in the rendered config (including a service restart). |
Pull Request (PR) description
This Pull Request (PR) fixes the following issues