我正致力于使用puppetlabs mongodb module启用验证。启用验证的木偶MongoDb
正如文档所说,要启用身份验证,我应该添加auth => true。 但是,为了验证工作,我have to add a user to the admin database,所以我做了,像这样:
mongodb::db { 'admin':
user => 'adminuser',
password_hash => 'a15fbfca5e3a758be80ceaf42458bcd8',
}
这适用于第一轮,但随后的运行中导致错误:
Mongodb::Db[admin]/Mongodb_database[admin]: Could not evaluate: Execution of '/usr/bin/mongo --quiet --eval db.getMongo().getDBNames()' returned 252: Wed Mar 26 16:28:40 uncaught exception: listDatabases failed:{ "errmsg" : "need to login", "ok" : 0 }
这使得因为现在无法进行身份验证来检查管理数据库是否已经存在。
你如何处理配置这个模块的mongodb密码认证?
有[dba.stackexchangecom](http://dba.stackexchange.com/)网站,你知道。和堆栈溢出**是**旨在**编程**问题和答案。 http://stackoverflow.com/help/on-topic –
@NeilLunn这更多的是一个devops问题。我现在也把它发布在ServerFault上。但似乎有些混淆,最好在哪里发布这类问题。 DBA甚至只提6个问题,甚至提到傀儡。 – bencoder
@bencoder上个月在https://ask.puppetlabs.com/question/5307/mongodb-authtrue/ –