edelight/chef-mongodb

mongodb_instance with different names using the same sysconfig file(which in turn force using the same mongo conf file)

manojVivek opened this issue · 1 comments

I am creating a new mongo instance using the following recipe:

mongodb_instance "test_mongo" do
        port 11111
        dbpath "/mongo_data"
end

Running this recipe made following:

Created /etc/sysconfig/mongodb with content:

#
# Automatically Generated by Chef, do not edit directly!
#

CONFIGFILE="/etc/mongodb.conf"
DAEMON="/usr/bin/$NAME"
DAEMONUSER="mongod"
DAEMON_OPTS="--config /etc/mongodb.conf"
DAEMON_USER="mongod"
ENABLE_MONGO="yes"
ENABLE_MONGOD="yes"
ENABLE_MONGODB="yes"

Created /etc/mongodb.conf with content:

#
# Automatically Generated by Chef, do not edit directly!
#

bind_ip = 0.0.0.0
dbpath = /var/lib/mongodb
fork = true
logappend = true
logpath = /var/log/mongodb/mongodb.log
nojournal = false
pidfilepath = /var/run/mongodb/mongodb.pid
port = 27017
rest = false
smallfiles = false

Created a /etc/init.d/test_mongo with usual content.

Here in the above generated files, the configs that I have mentioned(port and datapath) were not considered.

Also if I run the following recipe with new name test_mongo_new also the same files are created except a new init.d file is created. Other config files were same.

mongodb_instance "test_mongo_new" do
        port 11111
        dbpath "/mongo_data"
end

Is this the intended behaviour?
What is wrong here?

This repo is EOL, but the code lives on at https://github.com/sous-chefs/mongodb. Could you give that cookbook a look and let us know if it doesn't fix your issue?