2014-08-25 14:10:18 +00:00
|
|
|
# {{ ansible_managed }}
|
2014-06-04 15:03:58 +00:00
|
|
|
|
2016-04-17 13:43:00 +00:00
|
|
|
net:
|
|
|
|
bindIp: {{ mongodb_net_bindip }}
|
2019-05-23 04:37:39 +00:00
|
|
|
{% if mongodb_major_version is version("3.6", "<") -%}
|
2016-04-17 13:43:00 +00:00
|
|
|
http:
|
|
|
|
enabled: {{ mongodb_net_http_enabled | to_nice_json }}
|
2018-02-16 16:09:00 +00:00
|
|
|
{% endif -%}
|
2016-04-17 13:43:00 +00:00
|
|
|
ipv6: {{ mongodb_net_ipv6 | to_nice_json }}
|
|
|
|
maxIncomingConnections: {{ mongodb_net_maxconns }}
|
|
|
|
port: {{ mongodb_net_port }}
|
2018-08-23 18:55:22 +00:00
|
|
|
{% if mongodb_net_ssl_pemfile is defined and mongodb_net_ssl_mode is defined and mongodb_net_ssl == 'enabled' -%}
|
|
|
|
ssl:
|
|
|
|
mode: {{ mongodb_net_ssl_mode }}
|
2019-04-19 08:44:50 +00:00
|
|
|
PEMKeyFile: {{ mongodb_net_ssl_pemfile }}
|
2018-08-23 18:55:22 +00:00
|
|
|
{% endif %}
|
2014-12-19 14:39:09 +00:00
|
|
|
|
2016-04-17 13:43:00 +00:00
|
|
|
processManagement:
|
|
|
|
fork: {{ mongodb_processmanagement_fork | to_nice_json}}
|
2016-04-27 06:28:47 +00:00
|
|
|
{% if mongodb_pidfile_path is defined and mongodb_pidfile_path != '' -%}
|
|
|
|
pidFilePath: {{ mongodb_pidfile_path }}
|
|
|
|
{% endif %}
|
2016-04-17 13:43:00 +00:00
|
|
|
|
|
|
|
{% if mongodb_replication_replset -%}
|
|
|
|
replication:
|
|
|
|
oplogSizeMB: {{ mongodb_replication_oplogsize | int }}
|
|
|
|
replSetName: {{ mongodb_replication_replset }}
|
|
|
|
{% if mongodb_storage_engine == 'mmapv1' -%}
|
|
|
|
secondaryIndexPrefetch: {{ mongodb_replication_replindexprefetch }}
|
|
|
|
{% endif %}
|
2014-12-19 14:39:09 +00:00
|
|
|
{% endif %}
|
2016-09-29 07:09:02 +00:00
|
|
|
|
2016-04-17 13:43:00 +00:00
|
|
|
security:
|
|
|
|
authorization: {{ mongodb_security_authorization }}
|
|
|
|
{% if mongodb_replication_replset and mongodb_security_authorization == 'enabled' -%}
|
|
|
|
keyFile: {{ mongodb_security_keyfile }}
|
2019-04-26 16:56:47 +00:00
|
|
|
{% endif -%}
|
|
|
|
javascriptEnabled: {{ mongodb_security_javascript_enabled | to_nice_json }}
|
2016-04-17 13:43:00 +00:00
|
|
|
|
|
|
|
storage:
|
|
|
|
dbPath: {{ mongodb_storage_dbpath }}
|
2018-09-11 12:46:52 +00:00
|
|
|
directoryPerDB: {{ mongodb_storage_dirperdb | to_nice_json }}
|
2016-04-17 13:43:00 +00:00
|
|
|
engine: {{ mongodb_storage_engine }}
|
|
|
|
journal:
|
|
|
|
enabled: {{ mongodb_storage_journal_enabled | to_nice_json }}
|
|
|
|
{% if mongodb_storage_engine == 'mmapv1' -%}
|
|
|
|
mmapv1:
|
|
|
|
quota:
|
|
|
|
enforced: {{ mongodb_storage_quota_enforced | to_nice_json }}
|
|
|
|
maxFilesPerDB: {{ mongodb_storage_quota_maxfiles }}
|
|
|
|
smallFiles: {{ mongodb_storage_smallfiles | to_nice_json }}
|
2019-04-26 16:56:47 +00:00
|
|
|
{% endif -%}
|
|
|
|
{% if mongodb_storage_engine == 'wiredTiger' -%}
|
2019-04-19 08:44:50 +00:00
|
|
|
wiredTiger:
|
|
|
|
engineConfig:
|
2019-04-26 16:56:47 +00:00
|
|
|
{% if mongodb_wiredtiger_cache_size is defined -%}
|
2019-04-19 08:44:50 +00:00
|
|
|
cacheSizeGB: {{ mongodb_wiredtiger_cache_size }}
|
2019-04-26 16:56:47 +00:00
|
|
|
{% endif -%}
|
|
|
|
directoryForIndexes: {{ mongodb_wiredtiger_directory_for_indexes | to_nice_json }}
|
|
|
|
{% endif %}
|
2019-04-19 08:44:50 +00:00
|
|
|
|
2016-04-17 13:43:00 +00:00
|
|
|
systemLog:
|
|
|
|
destination: {{ mongodb_systemlog_destination }}
|
2018-01-19 14:05:24 +00:00
|
|
|
{% if mongodb_systemlog_destination == 'file' -%}
|
2016-04-17 13:43:00 +00:00
|
|
|
logAppend: {{ mongodb_systemlog_logappend | to_nice_json }}
|
2018-03-08 13:38:26 +00:00
|
|
|
logRotate: {{ mongodb_systemlog_logrotate }}
|
2016-04-17 13:43:00 +00:00
|
|
|
path: {{ mongodb_systemlog_path }}
|
2018-01-19 14:05:24 +00:00
|
|
|
{% endif %}
|
2018-01-09 11:39:07 +00:00
|
|
|
|
2019-04-26 16:56:47 +00:00
|
|
|
operationProfiling:
|
|
|
|
slowOpThresholdMs: {{ mongodb_operation_profiling_slow_op_threshold_ms }}
|
|
|
|
mode: {{ mongodb_operation_profiling_mode }}
|
|
|
|
|
2019-06-01 09:25:46 +00:00
|
|
|
{% if mongodb_major_version is version("4.0", ">=") -%}
|
2019-05-31 12:38:56 +00:00
|
|
|
cloud:
|
|
|
|
monitoring:
|
|
|
|
free:
|
|
|
|
state: {{ mongodb_cloud_monitoring_free_state }}
|
2019-06-01 09:25:46 +00:00
|
|
|
{% endif -%}
|
2019-05-31 12:38:56 +00:00
|
|
|
|
2018-01-09 11:39:07 +00:00
|
|
|
{% if mongodb_set_parameters -%}
|
|
|
|
setParameter:
|
|
|
|
{% for key, value in mongodb_set_parameters.items() -%}
|
|
|
|
{{ key }}: {{ value }}
|
|
|
|
{% endfor -%}
|
|
|
|
{% endif %}
|