# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# Where and how to store data.
storage:
  dbPath: {{ db_path }}
  journal:
    enabled: true
  engine: "wiredTiger"


# how the process runs
processManagement:
{% if ansible_facts.os_family == "RedHat" %}  # Breaks Ubuntu / Debian
  fork: true
{% if not is_redhat_8_in_docker %}
  pidFilePath: /var/run/mongodb/mongod.pid
{% endif %}
{% endif %}
  timeZoneInfo: /usr/share/zoneinfo

# network interfaces
net:
  port: {{ mongod_port }}
  bindIp: {{ bind_ip }}

{% if authorization == "enabled" %}
security:
  authorization: {{ authorization }}
{% if replicaset or sharding %}
  keyFile: /etc/keyfile
{% endif %}
{% endif %}

#operationProfiling:

{% if replicaset %}
replication:
  replSetName: {{ repl_set_name }}
{% endif %}

{% if sharding %}
sharding:
  clusterRole: shardsvr
{% endif %}
