From 5960c38f7b103da3e89971d4a19634e308c81ca5 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Jul 2018 13:57:43 +0200 Subject: [PATCH] fix init config --- templates/etc/mongod_init.conf.j2 | 39 ++++++++++++++----------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/templates/etc/mongod_init.conf.j2 b/templates/etc/mongod_init.conf.j2 index a744729..37e8d1b 100644 --- a/templates/etc/mongod_init.conf.j2 +++ b/templates/etc/mongod_init.conf.j2 @@ -1,5 +1,4 @@ ## {{ ansible_managed }} - # mongod.conf # for documentation of all options, see: @@ -7,35 +6,33 @@ # where to write logging data. systemLog: - destination: file - logAppend: true + destination: {{ mongodb_systemlog_destination }} + logAppend: {{ mongodb_systemlog_logappend | lower }} path: /var/log/mongodb/mongod.log # Where and how to store data. storage: - dbPath: /var/lib/mongo + dbPath: {{ mongodb_storage_dbpath }} journal: - enabled: true -# engine: -# mmapv1: -# wiredTiger: + enabled: {{ mongodb_storage_journal_enabled | lower }} # how the process runs processManagement: - fork: true # fork and run in background - pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile + fork: {{ mongodb_processmanagement_fork_enabled | lower }} + pidFilePath: /var/run/mongodb/mongod.pid timeZoneInfo: /usr/share/zoneinfo # network interfaces net: - port: 27017 - bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces. - - -#security: - -#operationProfiling: - -#replication: - -#sharding: + bindIp: {{ mongodb_net_bindip | join(',') }} + {% if mongodb_version is version_compare("3.6", "<") -%} + http: + enabled: {{ mongodb_net_http_enabled | lower }} + {% endif -%} + ipv6: {{ mongodb_net_ipv6_enabled | lower }} + maxIncomingConnections: {{ mongodb_net_maxconns }} + port: {{ mongodb_net_port }} + + +security: + authorization: disabled