From: Guillaume Abrioux Date: Tue, 15 Sep 2020 07:48:31 +0000 (+0200) Subject: infra: support log rotation for tcmu-runner X-Git-Tag: v5.0.2~46 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3e53d2a81144b91d18ef24e294073efe761f42a0;p=ceph-ansible.git infra: support log rotation for tcmu-runner This commit adds the log rotation support for tcmu-runner. ceph-container related PR: ceph/ceph-container#1726 Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1873915 Signed-off-by: Guillaume Abrioux (cherry picked from commit f576c02ff7b15c207b77b3f206a3213184b89889) --- diff --git a/roles/ceph-infra/templates/logrotate.conf.j2 b/roles/ceph-infra/templates/logrotate.conf.j2 index c64d4e03d..c2ed6c025 100644 --- a/roles/ceph-infra/templates/logrotate.conf.j2 +++ b/roles/ceph-infra/templates/logrotate.conf.j2 @@ -10,3 +10,16 @@ notifempty su root root } + +/var/log/tcmu-runner/*.log { + rotate 7 + daily + compress + sharedscripts + postrotate + killall -q -1 tcmu-runner || pkill -1 -x "tcmu-runner" + endscript + missingok + notifempty + su root root +} diff --git a/roles/ceph-iscsi-gw/tasks/containerized.yml b/roles/ceph-iscsi-gw/tasks/containerized.yml index b5dc4e95d..bea446ded 100644 --- a/roles/ceph-iscsi-gw/tasks/containerized.yml +++ b/roles/ceph-iscsi-gw/tasks/containerized.yml @@ -6,6 +6,7 @@ with_items: - rbd-target-api - rbd-target-gw + - tcmu-runner - name: include_tasks systemd.yml include_tasks: systemd.yml diff --git a/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 b/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 index 0b1579b27..164b9b333 100644 --- a/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 +++ b/roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2 @@ -28,7 +28,7 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm \ -v /dev:/dev \ -v /lib/modules:/lib/modules \ -v /etc/ceph:/etc/ceph \ - -v /var/log/ceph:/var/log/ceph:z \ + -v /var/log/tcmu-runner:/var/log/tcmu-runner:z \ -e CLUSTER={{ cluster }} \ -e CEPH_DAEMON=TCMU_RUNNER \ -e CONTAINER_IMAGE={{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \