From d970d5401fe3882765639ede385204c1e26f0c05 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Mon, 23 Aug 2021 14:32:49 -0400 Subject: [PATCH] lrc: Have logrotate cronjob optionally run the cephadm-created conf cephadm manages a different logrotate file. That file's name is the cluster FSID. So I'll defined lrc_fsid in the secrets repo and this task will change the cronjob to run that logrotate file instead of the ceph-common one (that wasn't doing anything useful anyway). Signed-off-by: David Galloway --- roles/long_running_cluster/tasks/logrotate.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/long_running_cluster/tasks/logrotate.yml b/roles/long_running_cluster/tasks/logrotate.yml index 27607cde..19ef8170 100644 --- a/roles/long_running_cluster/tasks/logrotate.yml +++ b/roles/long_running_cluster/tasks/logrotate.yml @@ -7,12 +7,13 @@ - name: "Write custom ceph logrotate config" template: src: ceph-common.logrotate - dest: /etc/logrotate.d/ceph-common + dest: /etc/logrotate.d/cm-ansible-ceph-common + when: lrc_fsid is not defined - name: "Create cronjob to logrotate every 6 hours" cron: name: "Logrotate ceph logs every 6 hours" minute: "25" hour: "0,6,12,18" - job: "/usr/sbin/logrotate -f /etc/logrotate.d/ceph-common" + job: "/usr/sbin/logrotate -f /etc/logrotate.d/{{ lrc_fsid|default('cm-ansible-ceph-common') }}" user: root -- 2.47.3