From: David Galloway Date: Mon, 23 Aug 2021 18:32:49 +0000 (-0400) Subject: lrc: Have logrotate cronjob optionally run the cephadm-created conf X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F647%2Fhead;p=ceph-cm-ansible.git 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 --- 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