Skip to content

Commit 2fb64ec

Browse files
committed
Fix config for 3.6.x versions
1 parent b5257ff commit 2fb64ec

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

templates/mongod.conf.j2

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
net:
44
bindIp: {{ mongodb_net_bindip }}
5+
{% if mongodb_major_version | version_compare("3.6", "<") -%}
56
http:
67
enabled: {{ mongodb_net_http_enabled | to_nice_json }}
8+
{% endif -%}
79
ipv6: {{ mongodb_net_ipv6 | to_nice_json }}
810
maxIncomingConnections: {{ mongodb_net_maxconns }}
911
port: {{ mongodb_net_port }}
@@ -31,7 +33,7 @@ security:
3133

3234
storage:
3335
dbPath: {{ mongodb_storage_dbpath }}
34-
{% if mongodb_major_version|float >= 3.0 -%}
36+
{% if mongodb_major_version | version_compare("3.0", ">=") -%}
3537
engine: {{ mongodb_storage_engine }}
3638
{% endif -%}
3739
journal:
@@ -42,13 +44,6 @@ storage:
4244
enforced: {{ mongodb_storage_quota_enforced | to_nice_json }}
4345
maxFilesPerDB: {{ mongodb_storage_quota_maxfiles }}
4446
smallFiles: {{ mongodb_storage_smallfiles | to_nice_json }}
45-
{% endif -%}
46-
{% if mongodb_major_version == '2.6' -%}
47-
quota:
48-
enforced: {{ mongodb_storage_quota_enforced | to_nice_json }}
49-
maxFilesPerDB: {{ mongodb_storage_quota_maxfiles }}
50-
preallocDataFiles: {{ mongodb_storage_prealloc | to_nice_json }}
51-
smallFiles: {{ mongodb_storage_smallfiles | to_nice_json }}
5247
{% endif %}
5348

5449
systemLog:

templates/mongod_init.conf.j2

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
net:
44
bindIp: '127.0.0.1'
5+
{% if mongodb_major_version | version_compare("3.6", "<") -%}
56
http:
67
enabled: {{ mongodb_net_http_enabled | to_nice_json }}
8+
{% endif -%}
79
ipv6: {{ mongodb_net_ipv6 | to_nice_json }}
810
maxIncomingConnections: {{ mongodb_net_maxconns }}
911
port: {{ mongodb_net_port }}
@@ -13,13 +15,13 @@ processManagement:
1315
{% if mongodb_pidfile_path is defined and mongodb_pidfile_path != '' -%}
1416
pidFilePath: {{ mongodb_pidfile_path }}
1517
{% endif %}
16-
18+
1719
security:
1820
authorization: 'disabled'
1921

2022
storage:
2123
dbPath: {{ mongodb_storage_dbpath }}
22-
{% if mongodb_major_version|float >= 3.0 -%}
24+
{% if mongodb_major_version | version_compare("3.0", ">=") -%}
2325
engine: {{ mongodb_storage_engine }}
2426
{% endif -%}
2527
journal:
@@ -30,13 +32,6 @@ storage:
3032
enforced: {{ mongodb_storage_quota_enforced | to_nice_json }}
3133
maxFilesPerDB: {{ mongodb_storage_quota_maxfiles }}
3234
smallFiles: {{ mongodb_storage_smallfiles | to_nice_json }}
33-
{% endif -%}
34-
{% if mongodb_major_version == '2.6' -%}
35-
quota:
36-
enforced: {{ mongodb_storage_quota_enforced | to_nice_json }}
37-
maxFilesPerDB: {{ mongodb_storage_quota_maxfiles }}
38-
preallocDataFiles: {{ mongodb_storage_prealloc | to_nice_json }}
39-
smallFiles: {{ mongodb_storage_smallfiles | to_nice_json }}
4035
{% endif %}
4136

4237
systemLog:

0 commit comments

Comments
 (0)