Fallback to monogb version from fact if no explicit version got provided#485
Fallback to monogb version from fact if no explicit version got provided#485bastelfreak merged 3 commits intovoxpupuli:masterfrom
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 |
| $version = $mongodb::server::version | ||
|
|
||
| if $mongodb::server::version == undef or $mongodb::server::version == '' { | ||
| $version = $::mongodb_version |
There was a problem hiding this comment.
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