puppet-mongodb
puppet-mongodb copied to clipboard
support for pure yaml in mongodb.cfg
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:
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
Dear @MaxFedotov, thanks for the PR!
This is Vox Pupuli Tasks, your friendly Vox Pupuli Github Bot. I noticed that your pull request has CI failures. Can you please have a look at the failing CI jobs? If you need any help, you can reach out to us on our IRC channel voxpupuli on Freenode or our Slack channel voxpupuli at slack.puppet.com. You can find my sourcecode at voxpupuli/vox-pupuli-tasks
Please note this is still not fixed and the commit it issue 587 just attempts to handle the config file being in yaml. To clarify if you have auth enabled and have defined an admin user and password when you run puppet the following error occurs...
Error: Could not prefetch mongodb_database provider 'mongodb': Could not evaluate MongoDB shell command: load('/root/.mongorc.js'); try { rs.secondaryOk() } catch (err) { rs.slaveOk() };printjson(db.getMongo().getDBs()) Error: Failed to apply catalog: Could not evaluate MongoDB shell command: load('/root/.mongorc.js'); try { rs.secondaryOk() } catch (err) { rs.slaveOk() };printjson(db.getMongo().getDBs())
You have to disable auth and run puppet which is then able to create the admin user / db...
Notice: /Stage[main]/Mongodb::Server/Mongodb::Db[admin]/Mongodb_user[User admin on db admin]/ensure: created
And then you can finally re-enable authentication. There is clearly a race condition here which needs to be handled.
@whiphubley I have a PR waiting that fixes the race condition (and moves to mogosh): https://github.com/voxpupuli/puppet-mongodb/pull/703 Feel free to give that a try. I rebased this PR (the yaml stuff) on top of some patches I have laying around, but require the aforementioned PR, for those, see https://github.com/stevenpost/puppet-mongodb/tree/provider_cleanup.
@whiphubley I have a PR waiting that fixes the race condition (and moves to mogosh): #703 Feel free to give that a try. I rebased this PR (the yaml stuff) on top of some patches I have laying around, but require the aforementioned PR, for those, see https://github.com/stevenpost/puppet-mongodb/tree/provider_cleanup.
Thanks @stevenpost I'll take a look at this...tho probs after Easter now. But to get this working would be a big win so thanks.
The 'race condition' is actually a dependency issue. Anyhow, the fix got merged into master. An updated version of this PR is now part of https://github.com/voxpupuli/puppet-mongodb/pull/723
Yes this is the last issue we really have with this module...so I look forward to testing it next week. Thanks again for all your work on this.