Skip to content

Fallback to monogb version from fact if no explicit version got provided#485

Merged
bastelfreak merged 3 commits intovoxpupuli:masterfrom
pixelpark:fix-upstream
Sep 3, 2018
Merged

Fallback to monogb version from fact if no explicit version got provided#485
bastelfreak merged 3 commits intovoxpupuli:masterfrom
pixelpark:fix-upstream

Conversation

@fbrehm
Copy link
Copy Markdown
Contributor

@fbrehm fbrehm commented Aug 31, 2018

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

@bastelfreak
Copy link
Copy Markdown
Member

Hi @fbrehm, thanks for the PR. Can you explain what you are trying to fix and take a look at the failing travis jobs?

@bastelfreak bastelfreak added bug Something isn't working tests-fail labels Aug 31, 2018
@fbrehm
Copy link
Copy Markdown
Contributor Author

fbrehm commented Aug 31, 2018

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

Comment thread manifests/server/config.pp Outdated
$version = $mongodb::server::version

if $mongodb::server::version == undef or $mongodb::server::version == '' {
$version = $::mongodb_version
Copy link
Copy Markdown
Member

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']

@fbrehm
Copy link
Copy Markdown
Contributor Author

fbrehm commented Sep 3, 2018

Made the changes - all tests seems to be okay

@bastelfreak bastelfreak changed the title Fix upstream Fallback to monogb version from fact if no explicit version got provided Sep 3, 2018
@bastelfreak
Copy link
Copy Markdown
Member

Thanks!

@bastelfreak bastelfreak merged commit 6129839 into voxpupuli:master Sep 3, 2018
@ekohl
Copy link
Copy Markdown
Member

ekohl commented Oct 8, 2018

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants