puppet-mongodb icon indicating copy to clipboard operation
puppet-mongodb copied to clipboard

catch errors based on missing authentication to allow creation of admin user on replicaset setup

Open Henning-B opened this issue 7 years ago • 10 comments

Pull Request (PR) description

When setting up a new replica set with authentication enabled the puppet run fails because some exceptions were not caught properly, when getting the user and database instances. When checking if the mongodb is a primary node a recheck without authentication is done to be able to create the admin user.

This Pull Request (PR) fixes the following issues

Henning-B avatar Aug 13 '18 11:08 Henning-B

I adapted the code as requested and fixed some issue. Do you need anything else to merge?

Henning-B avatar Aug 15 '18 13:08 Henning-B

Should work now

Henning-B avatar Aug 27 '18 08:08 Henning-B

The issue happens when setting up a new replicaset with authentication enabled. The self.instances get an authentication error, because neither the admin database nor the administrative user have been created, yet. So the whole catalog fails.

Henning-B avatar Aug 27 '18 13:08 Henning-B

All fixes were to ensure a puppet run on a bare system to setup a new replicaset. When Authentication is enabled in mongodb configuration you're allowed to create one admin user. Before this user has been created it is not possible to access the databases or users. So self.instances fail before is_master gets relevant, which is when the database / user ought to be created.

Henning-B avatar Sep 14 '18 10:09 Henning-B

I'm working on a big update that enables spec tests again (https://github.com/voxpupuli/puppet-mongodb/pull/491). Currently I'm at the point that I've verified the problem but after a full day my brain is done with it. Tomorrow I'm going to take a stab at integrating this into it.

ekohl avatar Oct 07 '18 00:10 ekohl

Could you rebase this on the current master? I put in a lot of effort to at least get acceptance tests working on CentOS7 (mongodb 2.6). With this fix I think we should also be able to get tests working on Debian and Ubuntu (mongodb 3.x).

ekohl avatar Oct 20 '18 19:10 ekohl

Dear @Henning-B, thanks for the PR!

This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

vox-pupuli-tasks[bot] avatar Nov 21 '19 09:11 vox-pupuli-tasks[bot]

Dear @Henning-B, thanks for the PR!

This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

vox-pupuli-tasks[bot] avatar Nov 21 '19 09:11 vox-pupuli-tasks[bot]

Dear @Henning-B, thanks for the PR!

This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

vox-pupuli-tasks[bot] avatar Jan 05 '20 13:01 vox-pupuli-tasks[bot]

Dear @Henning-B, thanks for the PR!

This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?

You can find my sourcecode at voxpupuli/vox-pupuli-tasks

vox-pupuli-tasks[bot] avatar Jan 05 '20 13:01 vox-pupuli-tasks[bot]

This should be handled by https://github.com/voxpupuli/puppet-mongodb/pull/703... We can close this.

witjoh avatar Mar 28 '24 09:03 witjoh