Debian Codegraph @

ansible_collections/community/mongodb/roles/mongodb_mongod/templates/mongod.conf.j2

raw
1 # mongod.conf
2
3 # for documentation of all options, see:
4 # http://docs.mongodb.org/manual/reference/configuration-options/
5
6 # where to write logging data.
7 systemLog:
8 destination: file
9 logAppend: true
10 path: {{ log_path }}
11 {% if mongodb_logrotate_enabled %}
12 logRotate: reopen
13 {% endif %}
14
15 # Where and how to store data.
16 storage:
17 dbPath: {{ db_path }}
18 {% if mongodb_version | float < 6.1 %}
19 journal:
20 enabled: true
21 {% endif %}
22 engine: "wiredTiger"
23
24 # how the process runs
25 processManagement:
26 {% if ansible_facts.os_family == "RedHat" and ansible_facts.distribution != "Amazon" and ansible_facts.distribution != "AlmaLinux" and ansible_facts.distribution != "Fedora" %} # Breaks Ubuntu / Debian
27 fork: true
28 pidFilePath: /var/run/mongodb/mongod.pid
29 {% endif %}
30 timeZoneInfo: /usr/share/zoneinfo
31
32 # network interfaces
33 net:
34 port: {{ mongod_port }}
35 {% if bind_ip_all %}
36 bindIpAll: true
37 {% else %}
38 bindIp: {{ bind_ip }}
39 {% endif %}
40 {% if net_compressors %}
41 compression:
42 compressors: {{ net_compressors }}
43 {% endif %}
44 {% if mongodb_use_tls %}
45 tls:
46 mode: requireTLS
47 certificateKeyFile: {{ mongodb_certificate_key_file }}
48 CAFile: {{ mongodb_certificate_ca_file }}
49 {% if mongodb_disabled_tls_protocols != "" %}
50 disabledProtocols: {{ mongodb_disabled_tls_protocols }}
51 {% endif %}
52 {% if mongodb_allow_connections_without_certificates %}
53 allowConnectionsWithoutCertificates: true
54 {% endif %}
55 {% endif %}
56
57 {% if authorization == "enabled" %}
58 security:
59 authorization: {{ authorization }}
60 {% if replicaset or sharding %}
61 keyFile: {{ openssl_keyfile_path }}
62 {% endif %}
63 {% endif %}
64
65 #operationProfiling:
66
67 {% if replicaset %}
68 replication:
69 replSetName: {{ repl_set_name }}
70 {% endif %}
71
72 {% if sharding %}
73 sharding:
74 clusterRole: shardsvr
75 {% endif %}