From 7d8c014cc5494d8cf80266f14d20bb1074990523 Mon Sep 17 00:00:00 2001 From: Patrick Dreker Date: Tue, 11 Sep 2018 10:01:53 +0200 Subject: [PATCH] Add mongodb_storage_dirperdb variable Add the mongodb_storage_dirperdb variable to the defaults (set to false) Add the variable unconditionally into the mongod_init.conf.j2 and mongod.conf.j2 templates. --- defaults/main.yml | 2 ++ templates/mongod.conf.j2 | 1 + templates/mongod_init.conf.j2 | 1 + 3 files changed, 4 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 0a3e76a..c0a94fc 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -41,6 +41,8 @@ mongodb_security_keyfile: /etc/mongodb-keyfile # Specify path to keyfile with ## storage Options mongodb_storage_dbpath: /data/db # Directory for datafiles +mongodb_storage_dirperdb: false # Use one directory per DB + # The storage engine for the mongod database. Available values: # 'mmapv1', 'wiredTiger' mongodb_storage_engine: "wiredTiger" diff --git a/templates/mongod.conf.j2 b/templates/mongod.conf.j2 index b7b243a..335d0df 100644 --- a/templates/mongod.conf.j2 +++ b/templates/mongod.conf.j2 @@ -38,6 +38,7 @@ security: storage: dbPath: {{ mongodb_storage_dbpath }} + directoryPerDB: {{ mongodb_storage_dirperdb }} {% if mongodb_major_version | version_compare("3.0", ">=") -%} engine: {{ mongodb_storage_engine }} {% endif -%} diff --git a/templates/mongod_init.conf.j2 b/templates/mongod_init.conf.j2 index e5ee5f1..07bc503 100644 --- a/templates/mongod_init.conf.j2 +++ b/templates/mongod_init.conf.j2 @@ -21,6 +21,7 @@ security: storage: dbPath: {{ mongodb_storage_dbpath }} + directoryPerDB: {{ mongodb_storage_dirperdb }} {% if mongodb_major_version | version_compare("3.0", ">=") -%} engine: {{ mongodb_storage_engine }} {% endif -%}