mongodb database setup unauthorized auth=true and enableLocalhostAuthBypass=1

253 views
Skip to first unread message

Ben Marengo

unread,
Mar 25, 2014, 12:06:20 PM3/25/14
to puppet...@googlegroups.com
hi all

i am having trouble trying to puppetize my mongodb setup using the module https://github.com/puppetlabs/puppetlabs-mongodb.

puppet fails when executing `/usr/bin/mongo --quiet --eval db.getMongo().getDBNames()`

the full error msg is 

`Error: /Stage[main]/Mongo::Deploy_mongo/Mongodb_database[mongotest]: Could not evaluate: Execution of '/usr/bin/mongo --quiet --eval db.getMongo().getDBNames()' returned 252: Tue Mar 25 14:37:23.250 listDatabases failed:{ "ok" : 0, "errmsg" : "unauthorized" } at src/mongo/shell/mongo.js:46`

i have set `auth=true` and `setParameter = enableLocalhostAuthBypass=1` in my conf file

my understanding was that even though `auth` was enabled, commands issued from the localhost are allowed to bypass it. can someone help me understand why the command above doesn't work?

thanks
ben

----------


ps. here is the full contents of /etc/mongodb.conf

    logpath=/local/mongodb/mongotest/log/mongotest.log
    logappend=true
    bind_ip = 127.0.0.1
    port = 27017
    dbpath=/local/mongodb/mongotest/data
    auth=true
    setParameter = enableLocalhostAuthBypass=1
Reply all
Reply to author
Forward
0 new messages