From a56b31eca38dd54c73dfe1c5b845ea0c9f310788 Mon Sep 17 00:00:00 2001 From: Juri Zirnsak Date: Mon, 10 Aug 2020 17:33:59 +0200 Subject: [PATCH 1/2] allow skipping global config changes in /etc/logrotate.conf --- defaults/main.yml | 2 ++ tasks/main.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index ceebd98..4f78988 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -34,6 +34,8 @@ logrotate_btmp: - create 0660 root utmp - rotate 1 +logrotate_global_config: True + # More log files can be added that will log rotate. # An example of multiple log rotate applications with available settings: # logrotate_applications: diff --git a/tasks/main.yml b/tasks/main.yml index 4119297..9d5b096 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -44,6 +44,7 @@ mode: 0644 tags: - configuration + when: logrotate_global_config | bool - name: 'create logrotate application configuration files' become: true From 386c2ad2f707c2371a92d3b0820b1b698ced4edb Mon Sep 17 00:00:00 2001 From: Juri Zirnsak Date: Mon, 10 Aug 2020 17:37:46 +0200 Subject: [PATCH 2/2] added documentation to README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index cb78a36..e1c83cb 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,14 @@ Path to the imclude files. logrotate_include_dir: /etc/logrotate.d ``` +### logrotate_global_config + +Enable global configuration of /etc/logrotate.conf + +```yml +logrotate_global_config: True +``` + ### logrotate_use_hourly_rotation Enable hourly rotation with cron.