[SERVER-14911] Add support to include config files in mongod.conf Created: 15/Aug/14  Updated: 23/Mar/15  Resolved: 10/Dec/14

Status: Closed
Project: Core Server
Component/s: Admin, Tools
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Tim Vaillancourt Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Hey guys,

I'd like to request the ability to include other config files from the mongod config file specified with '-f/--config', if it does not already exist.

This would make deployments of mongo much less painless to package/deploy from a sysops level.

My suggestion is the main config files settings can be overriden by the included file, ie: if my main config has dbpath=/mongodata, and my included config file has dbpath=/mongodata27017, the included file dbpath would take precedence.

Lastly, if a directory of configs could be included as well as single-files, that would be even more flexible.

Thanks!

Tim



 Comments   
Comment by Tim Vaillancourt [ 09/Dec/14 ]

Thanks Matt, sorry for the delay.

I think we'll go with option #3. Not-hacking the YAML standard is completely understandable . Feel free to close this one.

Cheers,

Tim

Comment by Matt Kangas [ 28/Aug/14 ]

As of 2.6, our config file format is YAML. YAML does not have an "include" syntax and we do not want to support a nonstandard variant of YAML.

It seems your use case could be solved several other ways:

  1. If mongod/mongos accepted multiple --config arguments and the files were logically concatenated.
  2. Invoking mongod/mongos via a custom wrapper that concatenates multiple YAML fragments into a single config file.
  3. Using a configuration management system like Chef/Puppet/Ansible to generate a YAML config file.

Using a configuration management system is probably your best option in the long run.

Generated at Thu Feb 08 03:36:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.