GitHub puppet-mongodb
mongodb installation

Repo Checks ( 14 of 22 successfull )
Metadata Valid
No translation
passed
Correct Puppet Version Range
Supported Puppet version range is %{PUPPET_SUPPORT_RANGE}
passed
With Puppet Version Range
Puppet version range is present in requirements in metadata.json
passed
With Operatingsystem Support
No translation
passed
Operatingsystems
No translation
passed
Supports Only Current Redhat
No translation
passed
Supports Latest Redhat
No translation
failed
Supports Only Current Centos
No translation
passed
Supports Latest Centos
No translation
failed
Supports Only Current Debian
No translation
failed
Supports Latest Debian
No translation
failed
Supports Only Current Ubuntu
No translation
passed
Supports Latest Ubuntu
No translation
failed
Supports Only Current Sles
No translation
passed
Supports Latest Sles
No translation
failed
In Modulesync Repo
Is listed as a module managed using modulesync_config
passed
Synced
Has a .msync.yml file
passed
Latest Modulesync
Has been synchronized with the latest tagged version of modulesync_config
failed
Has Modulesync
Is present in voxpupuli/modulesync_config/managed_modules.yml
passed
Released
Is in modulesync_config and in forge releases.
passed
Valid Sync File
If a (optional) sync file is present, it must not contain a `.travis.yml` entry.
passed
Reference Dot Md
The repository has a REFERENCE.md. It needs to be generated / puppet-strings documentation is missing.
failed

Open Pull Requests

Add support for net.ssl.allowConnectionsWithoutCertificates setting in mongod.conf
enhancement
needs-tests
needs-work
tests-fail
merge-conflicts

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

Add support for net.ssl.allowConnectionsWithoutCertificates setting in mongod.conf

This Pull Request (PR) fixes the following issues

Open PR in GitHub
#449 separate definition of /root/.mongorc.js file
needs-work
merge-conflicts

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

<!--
separate definition of /root/.mongorc.js file
-->

This Pull Request (PR) fixes the following issues

<!--
Fixes #449
-->

Open PR in GitHub
PR#182 addon: arbiter documentation + parameter replset_arbiter for mongodb::server
needs-rebase
tests-fail
merge-conflicts

The README currently does not give a hint how to configure an arbiter node for a replica set. That feature has been introduced with pull request #182.
It should also be possible to configure an arbiter by parameter replset_arbiter of mongodb::server.

Open PR in GitHub
Reorder switches in dbpath_fix find command
bug
needs-feedback

Pull Request (PR) description

Fix ordering of switches in dbpath_fix's find command

This Pull Request (PR) fixes the following issues

Fixes #571

Open PR in GitHub
support for pure yaml in mongodb.cfg
tests-fail

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

Support for pure yaml in /etc/mongodb.cfg.
Right now only records like net.bindIp are supported, and if for example, you are using custom configuration template and your configuration looks like:
yaml
net:
port: 27017
bindIp: 0.0.0.0

you will get an error like Error: Could not prefetch mongodb_database provider 'mongodb': Could not evaluate MongoDB shell command: load('/root/.mongorc.js'); rs.slaveOk();printjson(db.getMongo().getDBs()) when using providers.
This PR adds support for both configuration file formats

This Pull Request (PR) fixes the following issues

Fixes #562 for user @seidler2547

Open PR in GitHub
draft: add x509 auth for admin user using mongosh

Pull Request (PR) description

This PR is a work in progress.

* adds x509 auth_mechanism for the admin user
* replaces mongo with mongosh, mainly using x509 authentication (for now)

It works for me in a already running setup, which I'm upgrading from 4.x to 6.x.

Setting up proper test nodes to keep supporting all versions supporting mongosh.

Not planning to stay compatible with mongo command, since its gone in 6.x

This Pull Request (PR) try to fix the following issues

Fixes #648
Fixes #642

will be very please with loads of comments and how to proceed with this.

(and need to do some work on the tests still )

Open PR in GitHub
Set correct auth_mechanism for updateUser
bug

Currently the mongodb command updateUser defaults to SCRAM-SHA-256 but you can't update these passwords.

And also show an error when the update goes wrong.

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

Currently the mongodb command updateUser defaults to SCRAM-SHA-256 but you can't update these passwords.

So now set the correct mecahnisms and handle the response of the command. So if you try to update this hash with SCRAM-SHA-256 you will see an error message. If you use scram_sha_1 it will update the password and continue like it should.

This Pull Request (PR) fixes the following issues

Fixes #649
Fixes https://github.com/voxpupuli/puppet-mongodb/pull/650

Open PR in GitHub
modulesync 5.2.0
merge-conflicts
modulesync

modulesync 5.1.0

Open PR in GitHub
Use confine to check the existence of a command needed for the fact to resolve
tests-fail

An initial puppet run (eg. in a vagrant box) will produce an error while trying to resolve the mongodbversion fact:
```
Facter: error while resolving custom fact "mongodb
version": undefined method '[]' for nil:NilClass
```
The reason is that the check for the existence of the mongo binary is inside the setcode block.

This pull request uses the fact confinement mechanism to pre-empt the fact resolution if the mongo binary is not available.

Open PR in GitHub
Fix for several issues: SSL, Replicaset initialization, Secondary checking and more.

Pull Request (PR) description

Fix for several issues: SSL, Replicaset initialization, Secondary checking, etc..

This Pull Request (PR) fixes the following issues

Enable MongoDB 5.0 support
Fix mongorcjs typo
Fixed mongorc.js type for secondary check
Add support for Mongo 4.x secondary check
Fix SSL support for MongoDB 4.x
Fix for MongoDB v4 Replica Set initialization

Open PR in GitHub
Improve mongo output handling
merge-conflicts
tests-fail

Improve mongo output handling

This PR contains multiple changes to improve stability of parsing mongo output:

changes printjson to JSON.stringify to avoid internal types

In many cases printjson is adding internal types (ObjectId, etc) to the output, which results in an invalid JSON that is not parseable by ruby.

For example, printjson(db.isMaster()) prints something like this:


{
"topologyVersion" : {
"processId" : ObjectId("60995bb5e421c84948b94087"),
"counter" : NumberLong(6)
},
...
}

adds logic to extract error object from a corrupted output

Currently, the handling of exceptions is broken because the existing logic is expecting something parseable in the output, but it's not a valid JSON even after sanitization:


Error: Authentication failed.
2021-05-11T15:35:19.647+0200 E QUERY [thread1] Error: Could not retrieve replica set config: {
"ok" : 0,
"errmsg" : "not authorized on admin to execute command { replSetGetConfig: 1.0, $clusterTime: { clusterTime: Timestamp(0, 0), signature: { hash: BinData(0, 0000000000000000000000000000000000000000), keyId: 0 } }, $readPreference: { mode: \"secondaryPreferred\" }, $db: \"admin\" }",
"code" : 13,
"codeName" : "Unauthorized",
"$clusterTime" : {
"clusterTime" : Timestamp(0, 0),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
} :
rs.conf@src/mongo/shell/utils.js:1323:11
@(shell eval):1:43'

Because of this, replica set provider (that relies on an error data) can't detect that the host is online and fails to properly initialize the replica set.

I've added code that attempts to extract an object in case an output is not a valid JSON.

adds check for error code when detecting failed authorization

The existing logic relies on an error message that potentially may change (because of i18n, etc), which may break it in a long run. I've added a check for a error code name, that is less likely to change.

Open PR in GitHub
Add sets_creation so we can disable this class on Arbitrator servers when auth is enabled

…while auth is enabled

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

On arbitrator servers you get the following message when auth is enabled:

Notice: /Stage[main]/Mongodb::Replset/Mongodb_replset[example_set]/ensure: created (corrective)
Warning: Host mongoarb01:27017 is available, but you are unauthorized because of authentication is enabled: true

In debug mode you can see:
```
Debug: Request failed: 'Execution of '/usr/bin/mongo admin --quiet --host 127.0.0.1:27017 --eval load('/root/.mongorc.js'); printjson(rs.conf())' returned 252: uncaught exception: Error: Could not retrieve replica set config: {

      "ok" : 0,

      "errmsg" : "not authorized on admin to execute command { replSetGetConfig: 1.0, lsid: { id: UUID(\"a2213cd2-e6c4-4d15-bf29-d01b7a54a838\") }, $db: \"admin\" }",

      "code" : 13,

      "codeName" : "Unauthorized"

} :
```
The admin user has all the needed rights but this errmsg keeps telling us it has not.

For this reason I created a variable so we can disable this class on our arbitrator nodes by setting:
mongodb::replset::sets_creation: false

This Pull Request (PR) fixes the following issues

<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->

Open PR in GitHub
Slack Integration Config
tests-fail

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

Added slack Integration to fix a know bug in OpsManager 4.4 in conf-mms.properties file

<!--

-->

This Pull Request (PR) fixes the following issues

Ops Manager 4.4. has known issue with slack integration. We contact support and they asked us to do couple

configurations which apparently are not in this monog module. Theses two settings are slack client id and client secret #### for slack integration.

Open PR in GitHub
Add default localhost real_ip
tests-fail

Pull Request (PR) description

Sometimes you just want to add a user or two to Mongo and not manage it with this module (because you're using managing it through Foreman/Katello as an example). In this case maybe all you want to do is:
```
class {'mongodb::globals':
managepackagerepo => false,
manage_package => false
}

mongodbuser { 'SOMEUSER':
ensure => present,
name => 'SOMEUSER',
password
hash => mongodbpassword('SOMEUSER', 'SOME_USER'),
database => 'admin',
roles => ['root', 'admin'],
tries => 10
}
```

Well and then you get Empty host component parsing HostAndPort from ":27017" and realize that all that's missing is just the bind_ip and that you don't want to do anything else with this module but add users... that's where this PR comes in!

This PR will add a default bind_ip of 127.0.0.1. This may be a poor hack because I don't know ruby from an implicit returning hole in the ground :) Either way, lets talk about it? maybe I'm doing something wrong? This PR seems reasonable however.

Open PR in GitHub
Fix password changing for SHA-1 mechanism #649

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

Added the mechanism parameter for the passwordhash command
```
def password
hash=(value)
if db
ismaster
command = {
updateUser: @resource[:username],
pwd: @resource[:passwordhash],
digestPassword: false
}
command[:mechanisms] = @resource[:auth
mechanism] == :scramsha1 ? ['SCRAM-SHA-1'] : ['SCRAM-SHA-256']

mongoeval("db.runCommand(#{command.tojson})", @resource[:database])
else
Puppet.warning 'User password operations are available only from master host'
end
end
```

Changed unit test for mongodbuser due to new expected line generated for passwordhash command.

This Pull Request (PR) fixes the following issues

Fixes #649

Open PR in GitHub
Add support for replication.enableMajorityReadConcern setting
enhancement
needs-work
merge-conflicts

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

Add support for replication.enableMajorityReadConcern setting in mongod.conf.

This Pull Request (PR) fixes the following issues

542

Open PR in GitHub
catch errors based on missing authentication to allow creation of admin user on replicaset setup
merge-conflicts

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

<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->

Open PR in GitHub
Make pidfilepath depend on global manage_pidfile

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

Add a switch to the pidfilepath, making it undef if the global manage_pidfile is set to false. This avoid having the pidFilePath populated in the mongo.conf when there is no need for a PID file. Actually prevents mongo to start on RHEL after a reboot of the host.

This Pull Request (PR) fixes the following issues

<!--

-->

Open PR in GitHub
Set version defaults with hiera data
enhancement

Pull Request (PR) description

Use hiera module level data to specify default versions and if a repository should be configured.

This will make adding new OSes easier.

2nd commit fixes some rpsec by adding facts so the service provider is detected correctly.

Open PR in GitHub
bump systemd: < 7.0.0
enhancement

Here is a pr for changing the max version of puppet-systemd to 6.0.0

<!--
Thank you for contributing to this project!

-->

Pull Request (PR) description

<!--
Replace this comment with a description of your pull request.
-->

This Pull Request (PR) fixes the following issues

<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->

Open PR in GitHub
Draft: Move to mongosh and support mongodb versions 4.4+ only
backwards-incompatible
needs-work
backwards-incompatible
needs-work

This is a breaking PR

  • move to mongodb-mongosh (mongo will not work anymore)
  • Only support mongodb version 4.4 and higher (following mongodb support cycle)
  • Still work in process
  • Tested on rhel8 an mongodb 6.x
Open PR in GitHub