]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
infra: support log rotation for tcmu-runner
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 15 Sep 2020 07:48:31 +0000 (09:48 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Thu, 17 Sep 2020 01:35:48 +0000 (21:35 -0400)
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 <gabrioux@redhat.com>
(cherry picked from commit f576c02ff7b15c207b77b3f206a3213184b89889)

roles/ceph-infra/templates/logrotate.conf.j2
roles/ceph-iscsi-gw/tasks/containerized.yml
roles/ceph-iscsi-gw/templates/tcmu-runner.service.j2

index c64d4e03dd334fd5061b96dd8d4ac5248b112b7f..c2ed6c0251d7d07e5fc9d1a10b346e706c2b7366 100644 (file)
     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
+}
index b5dc4e95d91f08d2c8694301b76e8c096f31b845..bea446ded9cb5e34b79371b5ae5d0cb251e7b456 100644 (file)
@@ -6,6 +6,7 @@
   with_items:
     - rbd-target-api
     - rbd-target-gw
+    - tcmu-runner
 
 - name: include_tasks systemd.yml
   include_tasks: systemd.yml
index 0b1579b270a84c5f033ba4744fa5c10fd4ae7021..164b9b333b913f6840380252ec5188a1cc67f81d 100644 (file)
@@ -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 }} \