From a77efe008d3a24fdb8972b08b21ef61ee732b00f Mon Sep 17 00:00:00 2001 From: Frederik Wagner Date: Thu, 8 Mar 2018 14:38:26 +0100 Subject: [PATCH] add systemLog.logRotate option as configurable --- defaults/main.yml | 1 + templates/mongod.conf.j2 | 1 + templates/mongod_init.conf.j2 | 1 + 3 files changed, 3 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index c1e3443..8bf0092 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -53,6 +53,7 @@ mongodb_storage_prealloc: true # Enable data file preallocatio ## If you specify 'file', you must also specify mongodb_systemlog_path. mongodb_systemlog_destination: "file" mongodb_systemlog_logappend: true # Append to logpath instead of over-writing +mongodb_systemlog_logrotate: "rename" # Logrotation behavior mongodb_systemlog_path: /var/log/mongodb/{{ mongodb_daemon_name }}.log # Log file to send write to instead of stdout ## replication Options diff --git a/templates/mongod.conf.j2 b/templates/mongod.conf.j2 index 627a830..124ef21 100644 --- a/templates/mongod.conf.j2 +++ b/templates/mongod.conf.j2 @@ -50,6 +50,7 @@ systemLog: destination: {{ mongodb_systemlog_destination }} {% if mongodb_systemlog_destination == 'file' -%} logAppend: {{ mongodb_systemlog_logappend | to_nice_json }} + logRotate: {{ mongodb_systemlog_logrotate }} path: {{ mongodb_systemlog_path }} {% endif %} diff --git a/templates/mongod_init.conf.j2 b/templates/mongod_init.conf.j2 index 314dd32..e5ee5f1 100644 --- a/templates/mongod_init.conf.j2 +++ b/templates/mongod_init.conf.j2 @@ -38,5 +38,6 @@ systemLog: destination: {{ mongodb_systemlog_destination }} {% if mongodb_systemlog_destination == 'file' -%} logAppend: {{ mongodb_systemlog_logappend | to_nice_json }} + logRotate: {{ mongodb_systemlog_logrotate }} path: {{ mongodb_systemlog_path }} {% endif -%}