Skip to content

Commit 872aaaa

Browse files
committed
Only configure cloud options on MongoDB >= 4.0
1 parent 28e947d commit 872aaaa

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ mongodb_systemlog_path: /var/log/mongodb/{{ mongodb_daemon_name }}.log # Log f
7171
mongodb_operation_profiling_slow_op_threshold_ms: 100
7272
mongodb_operation_profiling_mode: "off"
7373

74-
## cloud options
74+
## cloud options (MongoDB >= 4.0)
7575
mongodb_cloud_monitoring_free_state: "runtime"
7676

7777
## replication Options

templates/mongod.conf.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ operationProfiling:
7171
slowOpThresholdMs: {{ mongodb_operation_profiling_slow_op_threshold_ms }}
7272
mode: {{ mongodb_operation_profiling_mode }}
7373

74+
{% if mongodb_major_version is version("4.0", ">=") -%}
7475
cloud:
7576
monitoring:
7677
free:
7778
state: {{ mongodb_cloud_monitoring_free_state }}
79+
{% endif -%}
7880

7981
{% if mongodb_set_parameters -%}
8082
setParameter:

0 commit comments

Comments
 (0)