From 2fb64ec439aee3c3cf403418fe77fce1d01c0724 Mon Sep 17 00:00:00 2001 From: Sergei Antipov Date: Fri, 16 Feb 2018 23:09:00 +0700 Subject: [PATCH] Fix config for 3.6.x versions --- templates/mongod.conf.j2 | 11 +++-------- templates/mongod_init.conf.j2 | 13 ++++--------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/templates/mongod.conf.j2 b/templates/mongod.conf.j2 index ba3ee92..627a830 100644 --- a/templates/mongod.conf.j2 +++ b/templates/mongod.conf.j2 @@ -2,8 +2,10 @@ net: bindIp: {{ mongodb_net_bindip }} + {% if mongodb_major_version | version_compare("3.6", "<") -%} http: enabled: {{ mongodb_net_http_enabled | to_nice_json }} + {% endif -%} ipv6: {{ mongodb_net_ipv6 | to_nice_json }} maxIncomingConnections: {{ mongodb_net_maxconns }} port: {{ mongodb_net_port }} @@ -31,7 +33,7 @@ security: storage: dbPath: {{ mongodb_storage_dbpath }} - {% if mongodb_major_version|float >= 3.0 -%} + {% if mongodb_major_version | version_compare("3.0", ">=") -%} engine: {{ mongodb_storage_engine }} {% endif -%} journal: @@ -42,13 +44,6 @@ storage: enforced: {{ mongodb_storage_quota_enforced | to_nice_json }} maxFilesPerDB: {{ mongodb_storage_quota_maxfiles }} smallFiles: {{ mongodb_storage_smallfiles | to_nice_json }} - {% endif -%} - {% if mongodb_major_version == '2.6' -%} - quota: - enforced: {{ mongodb_storage_quota_enforced | to_nice_json }} - maxFilesPerDB: {{ mongodb_storage_quota_maxfiles }} - preallocDataFiles: {{ mongodb_storage_prealloc | to_nice_json }} - smallFiles: {{ mongodb_storage_smallfiles | to_nice_json }} {% endif %} systemLog: diff --git a/templates/mongod_init.conf.j2 b/templates/mongod_init.conf.j2 index 2774560..314dd32 100644 --- a/templates/mongod_init.conf.j2 +++ b/templates/mongod_init.conf.j2 @@ -2,8 +2,10 @@ net: bindIp: '127.0.0.1' + {% if mongodb_major_version | version_compare("3.6", "<") -%} http: enabled: {{ mongodb_net_http_enabled | to_nice_json }} + {% endif -%} ipv6: {{ mongodb_net_ipv6 | to_nice_json }} maxIncomingConnections: {{ mongodb_net_maxconns }} port: {{ mongodb_net_port }} @@ -13,13 +15,13 @@ processManagement: {% if mongodb_pidfile_path is defined and mongodb_pidfile_path != '' -%} pidFilePath: {{ mongodb_pidfile_path }} {% endif %} - + security: authorization: 'disabled' storage: dbPath: {{ mongodb_storage_dbpath }} - {% if mongodb_major_version|float >= 3.0 -%} + {% if mongodb_major_version | version_compare("3.0", ">=") -%} engine: {{ mongodb_storage_engine }} {% endif -%} journal: @@ -30,13 +32,6 @@ storage: enforced: {{ mongodb_storage_quota_enforced | to_nice_json }} maxFilesPerDB: {{ mongodb_storage_quota_maxfiles }} smallFiles: {{ mongodb_storage_smallfiles | to_nice_json }} - {% endif -%} - {% if mongodb_major_version == '2.6' -%} - quota: - enforced: {{ mongodb_storage_quota_enforced | to_nice_json }} - maxFilesPerDB: {{ mongodb_storage_quota_maxfiles }} - preallocDataFiles: {{ mongodb_storage_prealloc | to_nice_json }} - smallFiles: {{ mongodb_storage_smallfiles | to_nice_json }} {% endif %} systemLog: