sous-chefs / sc-mongodb

Development repository for the sc-mongodb cookbook
https://supermarket.chef.io/cookbooks/sc-mongodb
Apache License 2.0
75 stars 91 forks source link

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

Open manojVivek opened 8 years ago

manojVivek commented 8 years ago

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?

jkulak commented 8 years ago

Yes, same here.

damacus commented 7 years ago

I'm adding this to the first bug-fix release (1.1.0) after the 1.0.0 rewrite, as to not make the rewrite an abolsolute slog.

If in the mean time you can rewrite some tests to cover this in inspec that'd be great!

github-actions[bot] commented 4 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.