{"action":"created","issue":{"url":"https://api.github.com/repos/sous-chefs/mongodb/issues/108","repository_url":"https://api.github.com/repos/sous-chefs/mongodb","labels_url":"https://api.github.com/repos/sous-chefs/mongodb/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/sous-chefs/mongodb/issues/108/comments","events_url":"https://api.github.com/repos/sous-chefs/mongodb/issues/108/events","html_url":"https://github.com/sous-chefs/mongodb/issues/108","id":146830221,"number":108,"title":"mongod instance starts instead of mongodb","user":{"login":"ngphban","id":5190762,"avatar_url":"https://avatars.githubusercontent.com/u/5190762?v=3","gravatar_id":"","url":"https://api.github.com/users/ngphban","html_url":"https://github.com/ngphban","followers_url":"https://api.github.com/users/ngphban/followers","following_url":"https://api.github.com/users/ngphban/following{/other_user}","gists_url":"https://api.github.com/users/ngphban/gists{/gist_id}","starred_url":"https://api.github.com/users/ngphban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngphban/subscriptions","organizations_url":"https://api.github.com/users/ngphban/orgs","repos_url":"https://api.github.com/users/ngphban/repos","events_url":"https://api.github.com/users/ngphban/events{/privacy}","received_events_url":"https://api.github.com/users/ngphban/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-04-08T06:41:08Z","updated_at":"2016-12-17T13:15:07Z","closed_at":null,"body":"Hi,\nThank your for this great cookbook\n\nI could deploy successfully this cookbook with the latest code in its repo (master).\nHowever, after completing the chef run on my vagrant box, I saw the mongod instance was started, in stead of mongodb.\n\n```\nroot@server01:/home/vagrant# service mongod status\nmongod start/running, process 5440\nroot@server01:/home/vagrant# service mongodb status\nmongodb stop/waiting\n```\n\nThe mongod instance allows anonymous access on its databases, which is the case I don't need\n\n```\nroot@server01:/home/vagrant# mongo localhost\nMongoDB shell version: 2.6.12\nconnecting to: localhost\nWelcome to the MongoDB shell.\nFor interactive help, type \"help\".\nFor more comprehensive documentation, see\n    http://docs.mongodb.org/\nQuestions? Try the support group\n    http://groups.google.com/group/mongodb-user\n> show databases\nadmin  0.078GB\nlocal  0.078GB\n> show users\n> use admin\nswitched to db admin\n> show users\n{\n    \"_id\" : \"admin.admin\",\n    \"user\" : \"admin\",\n    \"db\" : \"admin\",\n    \"roles\" : [\n        {\n            \"role\" : \"root\",\n            \"db\" : \"admin\"\n        },\n        {\n            \"role\" : \"userAdminAnyDatabase\",\n            \"db\" : \"admin\"\n        },\n        {\n            \"role\" : \"dbAdminAnyDatabase\",\n            \"db\" : \"admin\"\n        }\n    ]\n}\n> exit\n```\n\nMy work-around is: stop mongod instance and start the mongodb. With this, I'm able to force authentication against access on my databases\n\n```\nroot@server01:/home/vagrant# service mongod stop\nmongod stop/waiting\nroot@server01:/home/vagrant# service mongodb start\nmongodb start/running, process 5621\nroot@server01:/home/vagrant# mongo localhost \nMongoDB shell version: 2.6.12\nconnecting to: localhost\n> show dbs\n2016-04-08T01:52:03.387+0000 listDatabases failed:{\n    \"ok\" : 0,\n    \"errmsg\" : \"not authorized on admin to execute command { listDatabases: 1.0 }\",\n    \"code\" : 13\n} at src/mongo/shell/mongo.js:47\n> \n```\n\nMy questions:\n- Is this an intention of the cookbook to make admins manually switch between two instances (mongod & mongodb)?\n- Any workarounds in the code so I don't have to manually switch over each instances? My case is I will deploy this cookbook automatically on production with mongdb instance started and mongod instance stopped. I don't want everybody can access my database server without any credentials.\n\nBelow are my role attributes\n\n```\n$ knife role show mongodb\nchef_type:           role\ndefault_attributes:\ndescription:         \nenv_run_lists:\njson_class:          Chef::Role\nname:                mongodb\noverride_attributes:\n  authentication:\n    password: MYPASSWORD\n    username: admin\n  mongodb:\n    admin:\n      database: admin\n      password: MYPASSWORD\n      roles:\n        root\n        userAdminAnyDatabase\n        dbAdminAnyDatabase\n      username: admin\n    config:\n      auth: true\n    install_method: mongodb-org\nrun_list:\n  recipe[mongodb]\n  recipe[mongodb::user_management]\n```\n\nI also attached logs of my chef-client run and Vagrant file for your info.\n[Vagrant.zip](https://github.com/chef-brigade/mongodb-cookbook/files/209704/Vagrant.zip)\n[Chef-client.zip](https://github.com/chef-brigade/mongodb-cookbook/files/209706/Chef-client.zip)\n\nMy vagrant box info:\n- Ubuntu 14.04 LTS\n- Vagrant 1.8.1\n"},"comment":{"url":"https://api.github.com/repos/sous-chefs/mongodb/issues/comments/267762182","html_url":"https://github.com/sous-chefs/mongodb/issues/108#issuecomment-267762182","issue_url":"https://api.github.com/repos/sous-chefs/mongodb/issues/108","id":267762182,"user":{"login":"damacus","id":40786,"avatar_url":"https://avatars.githubusercontent.com/u/40786?v=3","gravatar_id":"","url":"https://api.github.com/users/damacus","html_url":"https://github.com/damacus","followers_url":"https://api.github.com/users/damacus/followers","following_url":"https://api.github.com/users/damacus/following{/other_user}","gists_url":"https://api.github.com/users/damacus/gists{/gist_id}","starred_url":"https://api.github.com/users/damacus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damacus/subscriptions","organizations_url":"https://api.github.com/users/damacus/orgs","repos_url":"https://api.github.com/users/damacus/repos","events_url":"https://api.github.com/users/damacus/events{/privacy}","received_events_url":"https://api.github.com/users/damacus/received_events","type":"User","site_admin":false},"created_at":"2016-12-17T13:15:07Z","updated_at":"2016-12-17T13:15:07Z","body":"Looks like we'll be doing some refactoring of the user_management & org_repo when we rewrite this. "}}
{"actor":{"display_login":"damacus"}}