ansible-role-mongodb/templates/mongod.conf.j2

69 lines
2.2 KiB
Plaintext
Raw Normal View History

# {{ ansible_managed }}
2014-06-04 15:03:58 +00:00
2016-04-17 13:43:00 +00:00
net:
bindIp: {{ mongodb_net_bindip }}
2018-02-16 16:09:00 +00:00
{% if mongodb_major_version | version_compare("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 }}
{% 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 }}
PEMKeyFile: {{ mongodb_net_ssl_pemfile }}.pem
{% 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}}
{% 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-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 }}
{% endif %}
storage:
dbPath: {{ mongodb_storage_dbpath }}
directoryPerDB: {{ mongodb_storage_dirperdb }}
2018-02-16 16:09:00 +00:00
{% if mongodb_major_version | version_compare("3.0", ">=") -%}
2016-04-17 13:43:00 +00:00
engine: {{ mongodb_storage_engine }}
{% endif -%}
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 }}
{% endif %}
systemLog:
destination: {{ mongodb_systemlog_destination }}
{% if mongodb_systemlog_destination == 'file' -%}
2016-04-17 13:43:00 +00:00
logAppend: {{ mongodb_systemlog_logappend | to_nice_json }}
logRotate: {{ mongodb_systemlog_logrotate }}
2016-04-17 13:43:00 +00:00
path: {{ mongodb_systemlog_path }}
{% endif %}
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 %}