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

Only create database and user when mongodb_is_master #558

Merged
merged 2 commits into from
Oct 7, 2019

Conversation

JvGinkel
Copy link
Contributor

@JvGinkel JvGinkel commented Oct 6, 2019

Pull Request (PR) description

Only create database and user when running on a primary/master node. This way we have idempotent runs again on none primary servers.

Unfortunately the fact returns a string true so there is some ugliness with lint:ignore in the if statement.

This Pull Request (PR) fixes the following issues

Fixes #412

@ekohl
Copy link
Member

ekohl commented Oct 6, 2019

Looks like this breaks tests and actually breaks idempotency in the acceptance tests. This is probably because the fact is not_installed before the first run meaning this breaks being able to provision in a single run.

@JvGinkel
Copy link
Contributor Author

JvGinkel commented Oct 6, 2019

@ekohl good point, I changed the condition so the code will always be executed unless the value is false what should mean that we are on a non-master node.

What do you think?

@bastelfreak
Copy link
Member

@JvGinkel can you take a look at the failing acceptance tests?

@bastelfreak
Copy link
Member

hrm. those issues might come for a new rspec/rspec-puppet release. CC: @alexjfisher

@JvGinkel
Copy link
Contributor Author

JvGinkel commented Oct 7, 2019

Hi @bastelfreak I just did a pdk bundle exec rake spec and I can't reproduce the errors so it's a bit hard to fix these.

@alexjfisher
Copy link
Member

@JvGinkel You can't reproduce it this morning because rspec-puppet 2.7.7 was released a few hours ago and it fixed the issue. I've restarted your build and now it passes.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be good to go.

@ekohl ekohl added the bug Something isn't working label Oct 7, 2019
@bastelfreak bastelfreak merged commit 358f1fb into voxpupuli:master Oct 7, 2019
@nmaludy nmaludy mentioned this pull request Feb 10, 2020
@oniGino
Copy link

oniGino commented Sep 24, 2020

This always returns true on my systems, am I missing something? Running puppet 5.5.20 with PE 2018.1 and module 3.1.0

@igalic
Copy link

igalic commented Sep 26, 2020

@oniGino does your system have more than one node?

@oniGino
Copy link

oniGino commented Sep 26, 2020

@oniGino does your system have more than one node?

Yes 3 nodes,

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.

user creation idempotency issues
6 participants