Skip to content
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

Merged
merged 3 commits into from
Sep 3, 2018

Conversation

fbrehm
Copy link
Contributor

@fbrehm fbrehm commented Aug 31, 2018

Pull Request (PR) description

This Pull Request (PR) fixes the following issues

@bastelfreak
Copy link
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
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

$version = $mongodb::server::version

if $mongodb::server::version == undef or $mongodb::server::version == '' {
$version = $::mongodb_version
Copy link
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
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
Member

Thanks!

@bastelfreak bastelfreak merged commit 6129839 into voxpupuli:master Sep 3, 2018
@ekohl
Copy link
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