Skip to content

Commit 8103d27

Browse files
authored
Merge pull request #152 from NeowayLabs/wiredtiger
Add more wiredtiger, security and profiling configs
2 parents 3cfe431 + 4ba3adc commit 8103d27

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

defaults/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ mongodb_processmanagement_fork: "{{ 'RedHat' == ansible_os_family }}"
4141
# Disable or enable security. Possible values: 'disabled', 'enabled'
4242
mongodb_security_authorization: "disabled"
4343
mongodb_security_keyfile: /etc/mongodb-keyfile # Specify path to keyfile with password for inter-process authentication
44+
mongodb_security_javascript_enabled: false
4445

4546
## storage Options
4647
mongodb_storage_dbpath: /data/db # Directory for datafiles
@@ -57,6 +58,8 @@ mongodb_storage_smallfiles: false # Very useful for non-data node
5758
mongodb_storage_journal_enabled: true # Enable journaling
5859
mongodb_storage_prealloc: true # Enable data file preallocation
5960

61+
mongodb_wiredtiger_directory_for_indexes: false
62+
6063
## systemLog Options
6164
## The destination to which MongoDB sends all log output. Specify either 'file' or 'syslog'.
6265
## If you specify 'file', you must also specify mongodb_systemlog_path.
@@ -65,6 +68,10 @@ mongodb_systemlog_logappend: true # Appen
6568
mongodb_systemlog_logrotate: "rename" # Logrotation behavior
6669
mongodb_systemlog_path: /var/log/mongodb/{{ mongodb_daemon_name }}.log # Log file to send write to instead of stdout
6770

71+
## operationProfiling Options
72+
mongodb_operation_profiling_slow_op_threshold_ms: 100
73+
mongodb_operation_profiling_mode: "off"
74+
6875
## replication Options
6976
mongodb_replication_replset: # Enable replication <setname>[/<optionalseedhostlist>]
7077
mongodb_replication_replindexprefetch: "all" # specify index prefetching behavior (if secondary) [none|_id_only|all]

templates/mongod.conf.j2

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ security:
3434
authorization: {{ mongodb_security_authorization }}
3535
{% if mongodb_replication_replset and mongodb_security_authorization == 'enabled' -%}
3636
keyFile: {{ mongodb_security_keyfile }}
37-
{% endif %}
37+
{% endif -%}
38+
javascriptEnabled: {{ mongodb_security_javascript_enabled | to_nice_json }}
3839

3940
storage:
4041
dbPath: {{ mongodb_storage_dbpath }}
@@ -50,13 +51,15 @@ storage:
5051
enforced: {{ mongodb_storage_quota_enforced | to_nice_json }}
5152
maxFilesPerDB: {{ mongodb_storage_quota_maxfiles }}
5253
smallFiles: {{ mongodb_storage_smallfiles | to_nice_json }}
53-
{% endif %}
54-
55-
{% if mongodb_wiredtiger_cache_size is defined %}
54+
{% endif -%}
55+
{% if mongodb_storage_engine == 'wiredTiger' -%}
5656
wiredTiger:
5757
engineConfig:
58+
{% if mongodb_wiredtiger_cache_size is defined -%}
5859
cacheSizeGB: {{ mongodb_wiredtiger_cache_size }}
59-
{% endif %}
60+
{% endif -%}
61+
directoryForIndexes: {{ mongodb_wiredtiger_directory_for_indexes | to_nice_json }}
62+
{% endif %}
6063

6164
systemLog:
6265
destination: {{ mongodb_systemlog_destination }}
@@ -66,6 +69,10 @@ systemLog:
6669
path: {{ mongodb_systemlog_path }}
6770
{% endif %}
6871

72+
operationProfiling:
73+
slowOpThresholdMs: {{ mongodb_operation_profiling_slow_op_threshold_ms }}
74+
mode: {{ mongodb_operation_profiling_mode }}
75+
6976
{% if mongodb_set_parameters -%}
7077
setParameter:
7178
{% for key, value in mongodb_set_parameters.items() -%}

0 commit comments

Comments
 (0)