Add logrotate meta configuration for Ceph
- parametrize interval and rotate
Related: PROD-29848
Change-Id: Id6c1a81588dff1b90feeebf2630091bba6511dbe
diff --git a/ceph/meta/logrotate.yml b/ceph/meta/logrotate.yml
new file mode 100644
index 0000000..2049001
--- /dev/null
+++ b/ceph/meta/logrotate.yml
@@ -0,0 +1,19 @@
+## Default: Daily rotation with 28 rotations kept
+{%- from "ceph/map.jinja" import common, mgr, mon, radosgw with context %}
+
+{%- if mgr.get('enabled', False) or mon.get('enabled', False) or radosgw.get('enabled', False) %}
+job:
+ ceph-common:
+ - files:
+ - /var/log/ceph/*.log
+ options:
+ - {{ common.get('logrotate', {}).get('interval', 'daily') }}
+ - rotate: {{ common.get('logrotate', {}).get('rotate', 28) }}
+ - compress
+ - sharedscripts
+ - missingok
+ - notifempty
+ - su root ceph
+ - postrotate:
+ killall -q -1 ceph-mon ceph-mgr ceph-mds ceph-osd ceph-fuse radosgw || true
+{%- endif %}